Skip to content

Commit

Permalink
[BUG-FIX] close files after loading lookup table
Browse files Browse the repository at this point in the history
  • Loading branch information
janmejay committed May 11, 2016
1 parent 44c6cd5 commit 3d2dc0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion runtime/lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ lookupReadFile(lookup_t *pThis, const uchar *name, const uchar *filename)
int eno;
char errStr[1024];
char *iobuf = NULL;
int fd;
int fd = -1;
ssize_t nread;
struct stat sb;
DEFiRet;
Expand Down Expand Up @@ -876,6 +876,9 @@ lookupReadFile(lookup_t *pThis, const uchar *name, const uchar *filename)
CHKiRet(lookupBuildTable(pThis, json, name));

finalize_it:
if (fd != -1) {
close(fd);
}
free(iobuf);
if(tokener != NULL)
json_tokener_free(tokener);
Expand Down

0 comments on commit 3d2dc0e

Please sign in to comment.