diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-03-22 23:25:09 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-03-22 23:25:09 +0000 |
commit | 1ce67b7672ab58afd76d0ad9cc0343e688c6770d (patch) | |
tree | 98443b5eacdf6f81e81f6c71e5a17141372126e5 /source3/libsmb | |
parent | dea7597767e690168e9485dfc2efabaab2dfb4cb (diff) | |
download | samba-1ce67b7672ab58afd76d0ad9cc0343e688c6770d.tar.gz samba-1ce67b7672ab58afd76d0ad9cc0343e688c6770d.tar.bz2 samba-1ce67b7672ab58afd76d0ad9cc0343e688c6770d.zip |
Valgrind found a few memory leaks!
Andrew Bartlett
(This used to be commit fb680f610ceb9a0f350c99456cf7ab1a507543fe)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/namecache.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/libsmb/namecache.c b/source3/libsmb/namecache.c index 40777011a1..d3541b7719 100644 --- a/source3/libsmb/namecache.c +++ b/source3/libsmb/namecache.c @@ -118,6 +118,7 @@ BOOL namecache_store(const char *name, int name_type, time_t expiry; char *key, *value_string; int i; + BOOL ret; /* * we use gecache call to avoid annoying debug messages about @@ -152,10 +153,17 @@ BOOL namecache_store(const char *name, int name_type, * First, store the number of ip addresses and then * place each single ip */ - ipstr_list_make(&value_string, ip_list, num_names); + if (!ipstr_list_make(&value_string, ip_list, num_names)) { + SAFE_FREE(key); + SAFE_FREE(value_string); + return False; + } /* set the entry */ - return (gencache_set(key, value_string, expiry)); + ret = gencache_set(key, value_string, expiry); + SAFE_FREE(key); + SAFE_FREE(value_string); + return ret; } |