summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-asprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/bsd-asprintf.c')
-rw-r--r--openbsd-compat/bsd-asprintf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c
index 00fa0dfd8..3368195d4 100644
--- a/openbsd-compat/bsd-asprintf.c
+++ b/openbsd-compat/bsd-asprintf.c
@@ -55,6 +55,7 @@ vasprintf(char **str, const char *fmt, va_list ap)
55 if (ret >= 0 && ret < INIT_SZ) { /* succeeded with initial alloc */ 55 if (ret >= 0 && ret < INIT_SZ) { /* succeeded with initial alloc */
56 *str = string; 56 *str = string;
57 } else if (ret == INT_MAX || ret < 0) { /* Bad length */ 57 } else if (ret == INT_MAX || ret < 0) { /* Bad length */
58 free(string);
58 goto fail; 59 goto fail;
59 } else { /* bigger than initial, realloc allowing for nul */ 60 } else { /* bigger than initial, realloc allowing for nul */
60 len = (size_t)ret + 1; 61 len = (size_t)ret + 1;