1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-07 00:58:40 +03:00

ndrdump: Small simplification

Remove the talloc_steal(), we can allocate on mem_ctx directly

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2022-02-07 10:11:36 +01:00 committed by Jeremy Allison
parent 60a7293321
commit b066dba462

View File

@ -553,10 +553,9 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
blob = hexdump_to_data_blob(mem_ctx, (const char *)data, size);
} else if (base64_input) {
/* Use talloc_strndup() to ensure null termination */
blob = base64_decode_data_blob(talloc_strndup(mem_ctx,
(const char *)data, size));
/* base64_decode_data_blob() allocates on NULL */
talloc_steal(mem_ctx, blob.data);
blob = base64_decode_data_blob_talloc(
mem_ctx,
talloc_strndup(mem_ctx, (const char *)data, size));
} else {
blob = data_blob_const(data, size);
}