summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-05-27 17:28:52 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-05-28 10:04:47 +0200
commite831af7f076fe464d8860535ecae1986299765bd (patch)
treea63016d61e13879b3294f9254e370c71da24c9b8
parent7a3a1cb5a76aae697f7a820c4fc5305f5684487f (diff)
downloadsamba-e831af7f076fe464d8860535ecae1986299765bd.tar.gz
samba-e831af7f076fe464d8860535ecae1986299765bd.tar.bz2
samba-e831af7f076fe464d8860535ecae1986299765bd.zip
s4:param/loadparm.c - fix "asprintf" call
-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) {