diff options
Diffstat (limited to 'apps/engine.c')
-rw-r--r-- | apps/engine.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/engine.c b/apps/engine.c index f54631b50d819..a8eed9af5c18c 100644 --- a/apps/engine.c +++ b/apps/engine.c @@ -108,13 +108,16 @@ static int append_buf(char **buf, const char *s, int *size, int step) } if (strlen(*buf) + strlen(s) >= (unsigned int)*size) { + char *p = *buf; + *size += step; *buf = OPENSSL_realloc(*buf, *size); + if (*buf == NULL) { + OPENSSL_free(p); + return 0; + } } - if (*buf == NULL) - return 0; - if (**buf != '\0') BUF_strlcat(*buf, ", ", *size); BUF_strlcat(*buf, s, *size); |