mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-29 10:01:41 +00:00
fix code analysis warnings - this time while awake
This commit is contained in:
parent
7fb6fb3076
commit
4cd07bc241
@ -391,8 +391,8 @@ ESL_DECLARE(int) esl_event_add_array(esl_event_t *event, const char *var, const
|
|||||||
data = strdup(val + 7);
|
data = strdup(val + 7);
|
||||||
|
|
||||||
len = (sizeof(char *) * max) + 1;
|
len = (sizeof(char *) * max) + 1;
|
||||||
esl_assert(len);
|
|
||||||
array = malloc(len);
|
array = malloc(len);
|
||||||
|
esl_assert(array);
|
||||||
memset(array, 0, len);
|
memset(array, 0, len);
|
||||||
|
|
||||||
idx = esl_separate_string_string(data, "|:", array, max);
|
idx = esl_separate_string_string(data, "|:", array, max);
|
||||||
@ -794,10 +794,12 @@ ESL_DECLARE(esl_status_t) esl_event_serialize(esl_event_t *event, char **str, es
|
|||||||
|
|
||||||
if ((len + llen) > dlen) {
|
if ((len + llen) > dlen) {
|
||||||
char *m;
|
char *m;
|
||||||
|
char *old = buf;
|
||||||
dlen += (blocksize + (len + llen));
|
dlen += (blocksize + (len + llen));
|
||||||
if ((m = realloc(buf, dlen))) {
|
if ((m = realloc(buf, dlen))) {
|
||||||
buf = m;
|
buf = m;
|
||||||
} else {
|
} else {
|
||||||
|
buf = old;
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -821,10 +823,12 @@ ESL_DECLARE(esl_status_t) esl_event_serialize(esl_event_t *event, char **str, es
|
|||||||
|
|
||||||
if ((len + llen) > dlen) {
|
if ((len + llen) > dlen) {
|
||||||
char *m;
|
char *m;
|
||||||
|
char *old = buf;
|
||||||
dlen += (blocksize + (len + llen));
|
dlen += (blocksize + (len + llen));
|
||||||
if ((m = realloc(buf, dlen))) {
|
if ((m = realloc(buf, dlen))) {
|
||||||
buf = m;
|
buf = m;
|
||||||
} else {
|
} else {
|
||||||
|
buf = old;
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user