diff options
author | Herb Lewis <herb@samba.org> | 2001-12-21 17:46:53 +0000 |
---|---|---|
committer | Herb Lewis <herb@samba.org> | 2001-12-21 17:46:53 +0000 |
commit | 7e0d6938b9ca1b64c321d300c577dac8aa0b548c (patch) | |
tree | 8827b576de7d7106714c63d7cf9e065aeff1ebc4 /source/nsswitch/wb_common.c | |
parent | 850fb4b5b49d39a52b1c0d58f79f796369c9ab37 (diff) | |
download | samba-7e0d6938b9ca1b64c321d300c577dac8aa0b548c.tar.gz samba-7e0d6938b9ca1b64c321d300c577dac8aa0b548c.tar.xz samba-7e0d6938b9ca1b64c321d300c577dac8aa0b548c.zip |
fix memory leak
Diffstat (limited to 'source/nsswitch/wb_common.c')
-rw-r--r-- | source/nsswitch/wb_common.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/nsswitch/wb_common.c b/source/nsswitch/wb_common.c index 082f3cae8f7..d3feaeb4504 100644 --- a/source/nsswitch/wb_common.c +++ b/source/nsswitch/wb_common.c @@ -31,6 +31,16 @@ int winbindd_fd = -1; /* fd for winbindd socket */ static char *excluded_domain; +/* Free a response structure */ + +void free_response(struct winbindd_response *response) +{ + /* Free any allocated extra_data */ + + if (response) + SAFE_FREE(response->extra_data); +} + /* smbd needs to be able to exclude lookups for its own domain */ @@ -290,6 +300,7 @@ int read_reply(struct winbindd_response *response) if ((result2 = read_sock(response->extra_data, extra_data_len)) == -1) { + free_response(response); return -1; } } @@ -299,16 +310,6 @@ int read_reply(struct winbindd_response *response) return result1 + result2; } -/* Free a response structure */ - -void free_response(struct winbindd_response *response) -{ - /* Free any allocated extra_data */ - - if (response) - SAFE_FREE(response->extra_data); -} - /* * send simple types of requests */ |