mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
security: fix memory and file descriptor leak on DM_STOP
This commit is contained in:
parent
36c88d403f
commit
e8047b0cde
1 changed files with 3 additions and 4 deletions
|
|
@ -141,8 +141,8 @@ static int browseSecurityCertificateInst(struct dmctx *dmctx, DMNODE *parent_nod
|
|||
struct certificate_profile certificateprofile = {};
|
||||
|
||||
get_certificate_paths();
|
||||
int i;
|
||||
for (i = 0; i < MAX_CERT; i++) {
|
||||
int i, status;
|
||||
for (i = 0, status = DM_OK; i < MAX_CERT && status != DM_STOP; i++) {
|
||||
if(!DM_STRLEN(certifcates_paths[i]))
|
||||
break;
|
||||
FILE *fp = fopen(certifcates_paths[i], "r");
|
||||
|
|
@ -162,8 +162,7 @@ static int browseSecurityCertificateInst(struct dmctx *dmctx, DMNODE *parent_nod
|
|||
|
||||
inst = handle_instance(dmctx, parent_node, dmmap_sect, "security_certificate_instance", "security_certificate_alias");
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&certificateprofile, inst) == DM_STOP)
|
||||
break;
|
||||
status = DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&certificateprofile, inst);
|
||||
|
||||
X509_free(cert);
|
||||
cert = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue