summaryrefslogtreecommitdiffstats
path: root/utf8.c
diff options
context:
space:
mode:
authorjsg@openbsd.org <jsg@openbsd.org>2017-02-02 11:54:25 +0100
committerDarren Tucker <dtucker@zip.com.au>2017-02-03 04:23:24 +0100
commit3ec5fa4ba97d4c4853620daea26a33b9f1fe3422 (patch)
tree03ba8ced0caf88feb5a81d0e0e1556cbccb28708 /utf8.c
parentupstream commit (diff)
downloadopenssh-3ec5fa4ba97d4c4853620daea26a33b9f1fe3422.tar.xz
openssh-3ec5fa4ba97d4c4853620daea26a33b9f1fe3422.zip
upstream commit
In vasnmprintf() return an error if malloc fails and don't set a function argument to the address of free'd memory. ok djm@ Upstream-ID: 1efffffff2f51d53c9141f245b90ac23d33b9779
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 87fa9e89a..ba60d61f2 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utf8.c,v 1.3 2016/05/30 12:57:21 schwarze Exp $ */
+/* $OpenBSD: utf8.c,v 1.4 2017/02/02 10:54:25 jsg Exp $ */
/*
* Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -116,6 +116,7 @@ vasnmprintf(char **str, size_t maxsz, int *wp, const char *fmt, va_list ap)
sz = strlen(src) + 1;
if ((dst = malloc(sz)) == NULL) {
free(src);
+ ret = -1;
goto fail;
}