Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
AOSP: misc: fix resource leak in populate_fs
[tools/e2fsprogs.git]
/
intl
/
vasnprintf.c
diff --git
a/intl/vasnprintf.c
b/intl/vasnprintf.c
index
8a62282
..
61bfb9e
100644
(file)
--- a/
intl/vasnprintf.c
+++ b/
intl/vasnprintf.c
@@
-801,8
+801,7
@@
VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
{
if (!(result == resultbuf || result == NULL))
free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
+ free (buf_malloced);
CLEANUP ();
errno = EINVAL;
return NULL;
@@
-860,8
+859,7
@@
VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
result = memory;
}
- if (buf_malloced != NULL)
- free (buf_malloced);
+ free (buf_malloced);
CLEANUP ();
*lengthp = length;
return result;
@@
-869,8
+867,7
@@
VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
out_of_memory:
if (!(result == resultbuf || result == NULL))
free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
+ free (buf_malloced);
out_of_memory_1:
CLEANUP ();
errno = ENOMEM;