diff options
author | Volker Lendecke <vl@samba.org> | 2008-05-06 15:06:12 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-05-06 15:08:30 +0200 |
commit | 1409ed60e2176e16fdd65b79ca502d9da6f11a74 (patch) | |
tree | 1893df0a9160f35d28ae615df95ef36d6579debc | |
parent | 89ac43d49859ef9169283341f2917e9100820bb4 (diff) | |
download | samba-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)
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 7 |
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, ""); |