loadparm: Fix memory leak issue.
authorHemanth Thummala <hemanth.thummala@nutanix.com>
Tue, 2 Feb 2016 18:33:20 +0000 (10:33 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 16 Feb 2016 08:00:28 +0000 (09:00 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11708

Signed-off-by: Hemanth Thummala <hemanth.thummala@nutanix.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb  4 12:39:14 CET 2016 on sn-devel-144

(cherry picked from commit 8247d93701ed838190fe74044a63a56d63d37bf5)

source3/param/loadparm.c

index 94de2520739d051cc19f6fe89b025b26d6cc582e..559623484501310291f26e2cbea0b6ebbd450bbb 100644 (file)
@@ -1289,7 +1289,7 @@ static int add_a_service(const struct loadparm_service *pservice, const char *na
                return (-1);
        }
        ServicePtrs = tsp;
-       ServicePtrs[iNumServices] = talloc_zero(NULL, struct loadparm_service);
+       ServicePtrs[iNumServices] = talloc_zero(ServicePtrs, struct loadparm_service);
        if (!ServicePtrs[iNumServices]) {
                DEBUG(0,("add_a_service: out of memory!\n"));
                return (-1);