From: Seungha Son Date: Tue, 16 Jan 2018 01:32:09 +0000 (+0900) Subject: Fix memory leak X-Git-Tag: accepted/tizen/unified/20180123.061141~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F167156%2F2;hp=0c0c5309c0fffcb1f535b15c942e50947cc166fe;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git Fix memory leak Signed-off-by: Seungha Son Change-Id: Ie70c36a8d56acb5b13b9ae7812a4c58f2d42a035 --- diff --git a/src/pkgmgrinfo_certinfo.c b/src/pkgmgrinfo_certinfo.c index ba072d6..f867c61 100644 --- a/src/pkgmgrinfo_certinfo.c +++ b/src/pkgmgrinfo_certinfo.c @@ -464,6 +464,8 @@ API int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_i retvm_if(cert_type > PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT, PMINFO_R_EINVAL, "Invalid certificate type\n"); pkgmgr_instcertinfo_x *certinfo = NULL; certinfo = (pkgmgr_instcertinfo_x *)handle; + if (certinfo->cert_info[cert_type]) + free(certinfo->cert_info[cert_type]); (certinfo->cert_info)[cert_type] = strdup(cert_value); return PMINFO_R_OK; }