summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/param/loadparm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 1264106a60..8c0f7d4d24 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -771,8 +771,8 @@ const char *lp_get_parametric(struct loadparm_context *lp_ctx,
struct loadparm_service *service,
const char *type, const char *option)
{
- char *vfskey;
- struct parmlist_entry *data;
+ char *vfskey = NULL;
+ struct parmlist_entry *data;
if (lp_ctx == NULL)
return NULL;
@@ -780,6 +780,7 @@ const char *lp_get_parametric(struct loadparm_context *lp_ctx,
data = (service == NULL ? lp_ctx->globals->param_opt : service->param_opt);
asprintf(&vfskey, "%s:%s", type, option);
+ if (vfskey == NULL) return NULL;
strlower(vfskey);
while (data) {