From: Volker Lendecke Date: Thu, 11 Jun 2026 11:56:33 +0000 (+0200) Subject: gensec: Fix an error path memleak in gensec_security_oids_from_ops() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c56a6790b4f9b17e355891f7d3ffce94a0bd537;p=thirdparty%2Fsamba.git gensec: Fix an error path memleak in gensec_security_oids_from_ops() Probably irrelevant, mostly to please possible static checkers Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/auth/gensec/gensec_start.c b/auth/gensec/gensec_start.c index 9f32c59bc87..54928b82ced 100644 --- a/auth/gensec/gensec_start.c +++ b/auth/gensec/gensec_start.c @@ -541,13 +541,15 @@ static const char **gensec_security_oids_from_ops( } for (k = 0; ops[i]->oid[k]; k++) { - oid_list = talloc_realloc(mem_ctx, - oid_list, - const char *, - j + 2); - if (!oid_list) { + const char **tmp = talloc_realloc(mem_ctx, + oid_list, + const char *, + j + 2); + if (tmp == NULL) { + TALLOC_FREE(oid_list); return NULL; } + oid_list = tmp; oid_list[j] = ops[i]->oid[k]; j++; }