[winpr,kerberos] fix a leak in failure handling

This commit is contained in:
akallabeth 2024-10-22 08:55:59 +02:00
parent b4dab0f419
commit fd8947ddc1
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -693,20 +693,26 @@ static BOOL kerberos_rd_tgt_req_tag2(WinPrAsn1Decoder* dec, char* buf, size_t le
BOOL first = TRUE;
while (WinPrAsn1DecPeekTag(dec, &tag))
{
BOOL success = FALSE;
char* lstr = NULL;
if (!WinPrAsn1DecReadGeneralString(dec, &lstr))
goto end;
goto fail;
if (!first)
{
if (!append(buf, len, "/"))
goto end;
goto fail;
}
first = FALSE;
if (!append(buf, len, lstr))
goto end;
goto fail;
success = TRUE;
fail:
free(lstr);
if (!success)
goto end;
}
rc = TRUE;
@ -779,7 +785,6 @@ static BOOL kerberos_rd_tgt_req(WinPrAsn1Decoder* dec, char** target)
rc = FALSE;
}
end:
if (rc)
*target = buf;
else