summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-05-06 15:06:12 +0200
committerVolker Lendecke <vl@samba.org>2008-05-06 15:08:30 +0200
commit1409ed60e2176e16fdd65b79ca502d9da6f11a74 (patch)
tree1893df0a9160f35d28ae615df95ef36d6579debc /source3
parent89ac43d49859ef9169283341f2917e9100820bb4 (diff)
downloadsamba-1409ed60e2176e16fdd65b79ca502d9da6f11a74.tar.gz
samba-1409ed60e2176e16fdd65b79ca502d9da6f11a74.tar.bz2
samba-1409ed60e2176e16fdd65b79ca502d9da6f11a74.zip
Fix a memleak in construct_printer_info_7()
Also fix a "ignoring asprintf result" warning (This used to be commit 64d21f39636019d6a17f84efc6fb9e61e67a235e)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index a7b477e17d..0e98a39426 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -4357,10 +4357,13 @@ static bool construct_printer_info_7(Printer_entry *print_hnd, PRINTER_INFO_7 *p
struct GUID guid;
if (is_printer_published(print_hnd, snum, &guid)) {
- asprintf(&guid_str, "{%s}",
- smb_uuid_string(talloc_tos(), guid));
+ if (asprintf(&guid_str, "{%s}",
+ smb_uuid_string(talloc_tos(), guid)) == -1) {
+ return false;
+ }
strupper_m(guid_str);
init_unistr(&printer->guid, guid_str);
+ SAFE_FREE(guid_str);
printer->action = SPOOL_DS_PUBLISH;
} else {
init_unistr(&printer->guid, "");