From fce0c22e07ba1e63d6c36ef8a8d358b9ba34109d Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sat, 23 May 2009 21:02:40 +0700 Subject: [PATCH] nsswitch/winbind_nss_aix.c(fill_grent): fixed memory leak. Found by cppcheck: [./nsswitch/winbind_nss_aix.c:241]: (error) Memory leak: result --- nsswitch/winbind_nss_aix.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/nsswitch/winbind_nss_aix.c b/nsswitch/winbind_nss_aix.c index 17578cf..66200f3 100644 --- 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; } -- 1.6.3.1