iconv sync 7/x: FreeBSD SVN 281798
authorJohn Marino <draco@marino.st>
Fri, 3 Jul 2015 22:19:27 +0000 (00:19 +0200)
committerJohn Marino <draco@marino.st>
Sat, 4 Jul 2015 08:19:06 +0000 (10:19 +0200)
Fix improbable memory leak in _citrus_prop_read_str()

lib/libc/citrus/citrus_prop.c

index ae89dad..ca75eb6 100644 (file)
@@ -290,8 +290,10 @@ done:
                }
                _memstream_ungetc(ms, ch);
                errnum = _citrus_prop_read_character_common(ms, &ch);
-               if (errnum != 0)
+               if (errnum != 0) {
+                       free(s);
                        return (errnum);
+               }
                s[n] = ch;
                ++n, --m;
        }