summaryrefslogtreecommitdiff
path: root/lib/param
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2019-06-14 13:57:59 +0000
committerNoel Power <npower@samba.org>2019-06-26 11:53:08 +0000
commit164570fcbbee16a7b42a0adb49c471f198b54a39 (patch)
tree3b92168e2becbc1fd8a167da29563e5e24e986fe /lib/param
parent9c586845665b779a698fad98dede42c214cfbff4 (diff)
downloadsamba-164570fcbbee16a7b42a0adb49c471f198b54a39.tar.gz
lib/param: clang: Fix 'dereference of a null pointer' warning
Fixes: lib/param/loadparm.c:3325:36: warning: Access to field 'szService' results in a dereference of a null pointer (loaded from variable 'service') <--[clang] return lpcfg_string((const char *)service->szService) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Wed Jun 26 11:53:08 UTC 2019 on sn-devel-184
Diffstat (limited to 'lib/param')
-rw-r--r--lib/param/loadparm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index e03c1556d7e..169d884ec04 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -3322,7 +3322,7 @@ struct loadparm_service *lpcfg_service(struct loadparm_context *lp_ctx,
const char *lpcfg_servicename(const struct loadparm_service *service)
{
- return lpcfg_string((const char *)service->szService);
+ return service ? lpcfg_string((const char *)service->szService) : NULL;
}
/**