diff options
author | Jeremy Allison <jra@samba.org> | 2012-05-31 15:06:58 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-05-31 16:08:44 -0700 |
commit | 8fd02fa2d6bdedbda1657a15f602bb4384367251 (patch) | |
tree | 1895c33c04d9dc0b3376308a126a037748a9c2ae /source3/printing | |
parent | f6e41026f89deb5393e239b9dc83b287e5c7d6ed (diff) | |
download | samba-8fd02fa2d6bdedbda1657a15f602bb4384367251.tar.gz samba-8fd02fa2d6bdedbda1657a15f602bb4384367251.tar.bz2 samba-8fd02fa2d6bdedbda1657a15f602bb4384367251.zip |
Forward port of Richard Sharpe's <realrichardsharpe@gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process.
Diffstat (limited to 'source3/printing')
-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)) { |