diff options
Diffstat (limited to 'source3/printing/load.c')
-rw-r--r-- | source3/printing/load.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/printing/load.c b/source3/printing/load.c index 161d71103c..af4dcc7a2b 100644 --- a/source3/printing/load.c +++ b/source3/printing/load.c @@ -31,6 +31,7 @@ static void add_auto_printers(void) int pnum = lp_servicenumber(PRINTERS_NAME); char *str; char *saveptr; + char *auto_serv = NULL; if (pnum < 0) if (process_registry_service(PRINTERS_NAME)) @@ -39,8 +40,12 @@ static void add_auto_printers(void) if (pnum < 0) return; - if ((str = SMB_STRDUP(lp_auto_services())) == NULL) + auto_serv = lp_auto_services(); + str = SMB_STRDUP(auto_serv); + TALLOC_FREE(auto_serv); + if (str == NULL) { return; + } for (p = strtok_r(str, LIST_SEP, &saveptr); p; p = strtok_r(NULL, LIST_SEP, &saveptr)) { |