summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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, "");