source3/loadparm: make struct loadparm_service a talloc object.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 23 Jul 2012 02:50:26 +0000 (12:20 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 23 Jul 2012 02:50:26 +0000 (12:20 +0930)
This gives us a place to allocate members from.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
source3/param/loadparm.c

index 8ba25a034662bb32ecfa52a2789cabb125986e41..a6ef8eda2b6299c7680b51b73e4d85a9bab46fbb 100644 (file)
@@ -5485,6 +5485,7 @@ static void free_service_byindex(int idx)
        }
 
        free_service(ServicePtrs[idx]);
+       talloc_free_children(ServicePtrs[idx]);
 }
 
 /***************************************************************************
@@ -5525,7 +5526,7 @@ static int add_a_service(const struct loadparm_service *pservice, const char *na
                        return (-1);
                }
                ServicePtrs = tsp;
-               ServicePtrs[iNumServices] = SMB_MALLOC_P(struct loadparm_service);
+               ServicePtrs[iNumServices] = talloc(NULL, struct loadparm_service);
                if (!ServicePtrs[iNumServices]) {
                        DEBUG(0,("add_a_service: out of memory!\n"));
                        return (-1);