git.samba.org
/
kamenim
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4258750
)
nsswitch/winbind_nss_aix.c(fill_grent): fixed memory leak.
author
Slava Semushin
<php-coder@altlinux.ru>
Sat, 23 May 2009 14:02:40 +0000
(21:02 +0700)
committer
Volker Lendecke
<vl@samba.org>
Mon, 25 May 2009 14:14:16 +0000
(16:14 +0200)
Found by cppcheck:
[./nsswitch/winbind_nss_aix.c:241]: (error) Memory leak: result
nsswitch/winbind_nss_aix.c
patch
|
blob
|
history
diff --git
a/nsswitch/winbind_nss_aix.c
b/nsswitch/winbind_nss_aix.c
index 17578cf3501ad2b79206e0003a52f41748338dc1..66200f35629808278aad9762086bd1ed599f96f8 100644
(file)
--- a/
nsswitch/winbind_nss_aix.c
+++ b/
nsswitch/winbind_nss_aix.c
@@
-237,6
+237,9
@@
static struct group *fill_grent(struct winbindd_gr *gr, char *gr_mem)
result->gr_mem = (char **)malloc(sizeof(char *) * (gr->num_gr_mem+1));
if (!result->gr_mem) {
+ free(result->gr_name);
+ free(result->gr_passwd);
+ free(result);
errno = ENOMEM;
return NULL;
}