diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-09-16 20:12:20 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-09-16 21:09:18 +1000 |
commit | b04b8b5610f23cd50c9a7a00eeca81229acd36d5 (patch) | |
tree | fa78496c6a9694b37addb1360a26d45cb718df4b | |
parent | a16328449171c1138bce3a9f32b7c1fa211e58d2 (diff) | |
download | samba-b04b8b5610f23cd50c9a7a00eeca81229acd36d5.tar.gz samba-b04b8b5610f23cd50c9a7a00eeca81229acd36d5.tar.bz2 samba-b04b8b5610f23cd50c9a7a00eeca81229acd36d5.zip |
wbclient: gr_mem can be NULL
if the structure was partly created and an error occurred, then don't
crash
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | nsswitch/libwbclient/wbc_pwd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nsswitch/libwbclient/wbc_pwd.c b/nsswitch/libwbclient/wbc_pwd.c index c7bfdb8fd8..1527808d88 100644 --- a/nsswitch/libwbclient/wbc_pwd.c +++ b/nsswitch/libwbclient/wbc_pwd.c @@ -100,6 +100,11 @@ static void wbcGroupDestructor(void *ptr) free(gr->gr_name); free(gr->gr_passwd); + /* if the array was partly created this can be NULL */ + if (gr->gr_mem == NULL) { + return; + } + for (i=0; gr->gr_mem[i] != NULL; i++) { free(gr->gr_mem[i]); } |