Skip to content

Commit

Permalink
cert_data: fix memory leak
Browse files Browse the repository at this point in the history
Release pCertName, if SecCertificateCopyValues() fails.

Found via cppcheck.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Cc: Vasily Kulikov <segoon@openwall.com>
Acked-by: Vasily Kulikov <segoon@openwall.com>
Message-Id: <1429540256-4906-1-git-send-email-yegorslists@googlemail.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9600
Signed-off-by: Gert Doering <gert@greenie.muc.de>
  • Loading branch information
yegorich authored and cron2 committed May 31, 2015
1 parent 859f6aa commit 7d30696
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contrib/keychain-mcd/cert_data.c
Expand Up @@ -146,6 +146,7 @@ CFArrayRef GetFieldsFromCertificate(SecCertificateRef certificate, CFTypeRef oid
printErrorMsg("GetFieldsFromCertificate: SecCertificateCopyValues", error);
CFRelease(keySelection);
CFRelease(fields);
destroyCertName(pCertName);
return NULL;
}
CFDictionaryRef vals = CFDictionaryGetValue(dict, oid);
Expand Down

0 comments on commit 7d30696

Please sign in to comment.