summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 38a4b26a60..cd67a3b88a 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -779,13 +779,16 @@ static BOOL convert_devicemode(const DEVICEMODE *devmode, NT_DEVICEMODE *nt_devm
nt_devmode->panningwidth=devmode->panningwidth;
nt_devmode->panningheight=devmode->panningheight;
+ safe_free(nt_devmode->private);
if (nt_devmode->driverextra != 0) {
/* if we had a previous private delete it and make a new one */
- safe_free(nt_devmode->private);
if((nt_devmode->private=(uint8 *)malloc(nt_devmode->driverextra * sizeof(uint8))) == NULL)
return False;
memcpy(nt_devmode->private, devmode->private, nt_devmode->driverextra);
}
+ else {
+ nt_devmode->private = NULL;
+ }
return True;
}