Commit 7114d160 authored by Mark Andrews's avatar Mark Andrews

fix memory leak

parent d2ca9e79
Pipeline #10150 passed with stages
in 17 minutes and 15 seconds
......@@ -467,25 +467,25 @@ decode_NegTokenInit(const unsigned char *p, size_t len, NegTokenInit * data, siz
FORW;
{
int dce_fix;
if ((dce_fix = fix_dce(reallen, &len)) < 0)
return ASN1_BAD_FORMAT;
if ((dce_fix = fix_dce(reallen, &len)) < 0) {
e = ASN1_BAD_FORMAT;
goto fail;
}
{
size_t newlen, oldlen;
e = der_match_tag(p, len, ASN1_C_CONTEXT, CONS, 0, &l);
if (e)
return e;
else {
p += l;
len -= l;
ret += l;
FORW;
{
e = der_get_length(p, len, &newlen, &l);
FORW;
{
int mydce_fix;
oldlen = len;
if ((mydce_fix = fix_dce(newlen, &len)) < 0)
return ASN1_BAD_FORMAT;
if ((mydce_fix = fix_dce(newlen, &len)) < 0) {
e = ASN1_BAD_FORMAT;
goto fail;
}
e = decode_MechTypeList(p, len, &(data)->mechTypes, &l);
FORW;
if (mydce_fix) {
......@@ -511,11 +511,15 @@ decode_NegTokenInit(const unsigned char *p, size_t len, NegTokenInit * data, siz
{
int mydce_fix;
oldlen = len;
if ((mydce_fix = fix_dce(newlen, &len)) < 0)
return ASN1_BAD_FORMAT;
if ((mydce_fix = fix_dce(newlen, &len)) < 0) {
e = ASN1_BAD_FORMAT;
goto fail;
}
(data)->reqFlags = malloc(sizeof(*(data)->reqFlags));
if ((data)->reqFlags == NULL)
return ENOMEM;
if ((data)->reqFlags == NULL) {
e = ENOMEM;
goto fail;
}
e = decode_ContextFlags(p, len, (data)->reqFlags, &l);
FORW;
if (mydce_fix) {
......@@ -541,11 +545,15 @@ decode_NegTokenInit(const unsigned char *p, size_t len, NegTokenInit * data, siz
{
int mydce_fix;
oldlen = len;
if ((mydce_fix = fix_dce(newlen, &len)) < 0)
return ASN1_BAD_FORMAT;
if ((mydce_fix = fix_dce(newlen, &len)) < 0) {
e = ASN1_BAD_FORMAT;
goto fail;
}
(data)->mechToken = malloc(sizeof(*(data)->mechToken));
if ((data)->mechToken == NULL)
return ENOMEM;
if ((data)->mechToken == NULL) {
e = ENOMEM;
goto fail;
}
e = decode_octet_string(p, len, (data)->mechToken, &l);
FORW;
if (mydce_fix) {
......@@ -571,11 +579,15 @@ decode_NegTokenInit(const unsigned char *p, size_t len, NegTokenInit * data, siz
{
int mydce_fix;
oldlen = len;
if ((mydce_fix = fix_dce(newlen, &len)) < 0)
return ASN1_BAD_FORMAT;
if ((mydce_fix = fix_dce(newlen, &len)) < 0) {
e = ASN1_BAD_FORMAT;
goto fail;
}
(data)->mechListMIC = malloc(sizeof(*(data)->mechListMIC));
if ((data)->mechListMIC == NULL)
return ENOMEM;
if ((data)->mechListMIC == NULL) {
e = ENOMEM;
goto fail;
}
e = decode_octet_string(p, len, (data)->mechListMIC, &l);
FORW;
if (mydce_fix) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment