diff options
author | Michael Adam <obnox@samba.org> | 2007-12-24 01:03:14 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2007-12-24 01:03:14 +0100 |
commit | 3177cece659b12114e37033a22becc595649d07a (patch) | |
tree | 1e3bc3f0ae4209049dbcb7893925fbe3c6c6fadd /source3/libnet/libnet_conf.c | |
parent | 713221e1c52db2df787ec8ec66c14f17b168cc78 (diff) | |
download | samba-3177cece659b12114e37033a22becc595649d07a.tar.gz samba-3177cece659b12114e37033a22becc595649d07a.tar.bz2 samba-3177cece659b12114e37033a22becc595649d07a.zip |
Do not leak memory in libnet_smbconf_delparm().
Michael
(This used to be commit 49cfe2b9ebe03d5985187890445b775047f8a2f4)
Diffstat (limited to 'source3/libnet/libnet_conf.c')
-rw-r--r-- | source3/libnet/libnet_conf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c index 4945413bb1..a371915a36 100644 --- a/source3/libnet/libnet_conf.c +++ b/source3/libnet/libnet_conf.c @@ -311,14 +311,19 @@ WERROR libnet_smbconf_delparm(TALLOC_CTX *mem_ctx, } werr = libnet_smbconf_open_path(mem_ctx, service, REG_KEY_ALL, &key); - W_ERROR_NOT_OK_RETURN(werr); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } if (!libnet_smbconf_value_exists(key, param)) { - return WERR_INVALID_PARAM; + werr = WERR_INVALID_PARAM; + goto done; } werr = reg_deletevalue(key, param); +done: + TALLOC_FREE(key); return werr; } |