git.samba.org
/
gd
/
samba
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19fa933
)
r11235: fix segfault in addprinter due to mixing talloc() and malloc()'d memory
author
Gerald Carter
<jerry@samba.org>
Thu, 20 Oct 2005 20:26:11 +0000
(20:26 +0000)
committer
Gerald Carter
<jerry@samba.org>
Thu, 20 Oct 2005 20:26:11 +0000
(20:26 +0000)
source/rpc_server/srv_spoolss_nt.c
patch
|
blob
|
history
diff --git
a/source/rpc_server/srv_spoolss_nt.c
b/source/rpc_server/srv_spoolss_nt.c
index a8fc1bc2293a86e9542cf19c7c94b4b959a9fc18..026e7681e00130ef905133de22984e6b802d34ed 100644
(file)
--- a/
source/rpc_server/srv_spoolss_nt.c
+++ b/
source/rpc_server/srv_spoolss_nt.c
@@
-7413,13
+7413,11
@@
static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
int snum;
WERROR err = WERR_OK;
- if (
(printer = SMB_MALLOC_P(NT_PRINTER_INFO_LEVEL)) == NULL
) {
+ if (
!(printer = TALLOC_ZERO_P(NULL, NT_PRINTER_INFO_LEVEL))
) {
DEBUG(0,("spoolss_addprinterex_level_2: malloc fail.\n"));
return WERR_NOMEM;
}
- ZERO_STRUCTP(printer);
-
/* convert from UNICODE to ASCII - this allocates the info_2 struct inside *printer.*/
if (!convert_printer_info(info, printer, 2)) {
free_a_printer(&printer, 2);