fix code analysis warnings - this time while awake

This commit is contained in:
Jeff Lenk 2011-05-26 11:32:07 -05:00
parent 7fb6fb3076
commit 4cd07bc241

View File

@ -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();
} }
} }