summaryrefslogtreecommitdiffstats
path: root/source3/param
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2014-02-28 11:38:51 +1300
committerAndrew Bartlett <abartlet@samba.org>2014-07-07 23:32:36 +0200
commit21d5c667d8538933e4b106394c4e06231813a2e8 (patch)
treedb4ace8677930497e1f120fdf920011041d15057 /source3/param
parent86284815fa5a9ffaa783c30b69a098db843ee6ad (diff)
downloadsamba-21d5c667d8538933e4b106394c4e06231813a2e8.tar.gz
samba-21d5c667d8538933e4b106394c4e06231813a2e8.tar.xz
samba-21d5c667d8538933e4b106394c4e06231813a2e8.zip
param: add failure case for loadparm_init_s3
It allocates memory, so it should be possible for it to fail. Change-Id: Ib24f9718fb88790de23b78435866b9e79fe8c705 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index f906dd956b..d9e4a91017 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -2648,6 +2648,12 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue
if (parm_table[parmnum].special) {
struct loadparm_context *lp_ctx = loadparm_init_s3(frame,
loadparm_s3_helpers());
+ if (lp_ctx == NULL) {
+ DEBUG(0, ("loadparm_init_s3 failed\n"));
+ TALLOC_FREE(frame);
+ return false;
+ }
+
lp_ctx->sDefault = &sDefault;
lp_ctx->services = ServicePtrs;
lp_ctx->bInGlobalSection = bInGlobalSection;