Skip to content

Commit

Permalink
Fix inputFile resource leak #27
Browse files Browse the repository at this point in the history
  • Loading branch information
kuloud committed Mar 10, 2020
1 parent 9b4ca54 commit 2626034
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions linux/src/plugin/AOECrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ int AOECrypto_decryptAoeFile_cbc(const char *srcFile, const char *dstFile, const
FILE *filewrite = fopen(dstFile, "w+");
if (NULL == filewrite)
{
fclose(inputFile);
return -1;
}

Expand Down Expand Up @@ -135,6 +136,7 @@ int AOECrypto_decryptAoeFile_cbc_mem(const char *srcFile, char **dstMem, const c
char *response = (char *)malloc(fileOrgLengh);
if (NULL == response)
{
fclose(inputFile);
return -1;
}

Expand Down Expand Up @@ -212,6 +214,7 @@ int AOECrypto_encryptAoeFile_Version1(const char *srcFile, const char *dstFile)
FILE *filewrite = fopen(dstFile, "w+");
if (NULL == filewrite)
{
fclose(file);
return -1;
}

Expand Down

0 comments on commit 2626034

Please sign in to comment.