diff options
| author | Adam <Adam@anope.org> | 2010-12-07 17:01:58 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-12-07 17:01:58 -0500 |
| commit | 2b7dd6c2a023186aefe12eaee7d33595379bf4c5 (patch) | |
| tree | 712274ce279d5a8fc08cd6538fbe2fbbf2f3ad52 /lang/langcomp.c | |
| parent | c5fc11f5fe92b31200dc6cf542514b1ffeb70c44 (diff) | |
Fixed some warnings found by cppcheck
Diffstat (limited to 'lang/langcomp.c')
| -rw-r--r-- | lang/langcomp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lang/langcomp.c b/lang/langcomp.c index cdafefb4c..e221cf672 100644 --- a/lang/langcomp.c +++ b/lang/langcomp.c @@ -77,10 +77,12 @@ int read_index_file() numstrings++; if (!(stringnames = calloc(sizeof(char *), numstrings))) { perror("calloc(stringnames)"); + fclose(f); return -1; } if (!(strings = calloc(sizeof(char *), numstrings))) { perror("calloc(strings)"); + fclose(f); return -1; } fseek(f, 0, SEEK_SET); @@ -90,6 +92,7 @@ int read_index_file() buf[strlen(buf)-1] = '\0'; if (!(stringnames[i++] = anopeStrDup(buf))) { perror("strdup()"); + fclose(f); return -1; } } @@ -201,6 +204,7 @@ int main(int ac, char **av) } if (!(out = fopen(outfile, "wb"))) { perror(outfile); + fclose(in); return 1; } |
