1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

s3-spoolss: Fixed winreg_delete_printer_key if key is NULL or emtpy.

Signed-off-by: Günther Deschner <gd@samba.org>
This commit is contained in:
Andreas Schneider 2010-04-23 14:45:48 +02:00 committed by Günther Deschner
parent 96a04b067e
commit 94a8482261

View File

@ -1700,13 +1700,17 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx,
rpccli_winreg_CloseKey(winreg_pipe, tmp_ctx, &key_hnd, NULL);
}
keyname = talloc_asprintf(tmp_ctx,
"%s\\%s",
path,
key);
if (keyname == NULL) {
result = WERR_NOMEM;
goto done;
if (key == NULL || key[0] == '\0') {
keyname = path;
} else {
keyname = talloc_asprintf(tmp_ctx,
"%s\\%s",
path,
key);
if (keyname == NULL) {
result = WERR_NOMEM;
goto done;
}
}
result = winreg_printer_delete_subkeys(tmp_ctx,