s4:loadparm: don't leak the names of all shares in each lp_service() call
authorStefan Metzmacher <metze@samba.org>
Fri, 23 Oct 2009 13:12:01 +0000 (15:12 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 24 Oct 2009 09:59:15 +0000 (11:59 +0200)
metze

source4/param/loadparm.c

index 882de1330e8e7477061ff61438948c86bc05f398..669e0d7d225b8335816f7906b20f9889b022acf6 100644 (file)
@@ -2609,8 +2609,11 @@ struct loadparm_service *lp_service(struct loadparm_context *lp_ctx,
                        serviceName = standard_sub_basic(
                                        lp_ctx->services[iService],
                                        lp_ctx->services[iService]->szService);
-                       if (strequal(serviceName, service_name))
+                       if (strequal(serviceName, service_name)) {
+                               talloc_free(serviceName);
                                return lp_ctx->services[iService];
+                       }
+                       talloc_free(serviceName);
                }
        }