summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_parse/parse_prs.c1
-rw-r--r--testsuite/printing/psec.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 58652fa0c5..0e5a25fe8c 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -1307,7 +1307,6 @@ int tdb_prs_fetch(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps, TALLOC_CTX *me
if (!dbuf.dptr)
return -1;
- ZERO_STRUCTP(ps);
prs_init(ps, 0, mem_ctx, UNMARSHALL);
prs_give_memory(ps, dbuf.dptr, dbuf.dsize, True);
diff --git a/testsuite/printing/psec.c b/testsuite/printing/psec.c
index 9d38b9b10a..7ba40b18a3 100644
--- a/testsuite/printing/psec.c
+++ b/testsuite/printing/psec.c
@@ -195,8 +195,11 @@ int psec_getsec(char *printer)
if (tdb_prs_fetch(tdb, keystr, &ps, mem_ctx) != 0) {
printf("error fetching descriptor for printer %s\n",
printer);
- result = 1;
- goto done;
+ /* cannot do a prs_mem_free() when tdb_prs_fetch fails */
+ /* as the prs structure has not been initialized */
+ tdb_close(tdb);
+ talloc_destroy(mem_ctx);
+ return 1;
}
/* Unpack into security descriptor buffer */