osmo-config-merge: fclose() what we fopen()

Change-Id: Ib44f902e5bca2277f1b340d34fabbd2a298d683e
Fixes: Coverity CID#188851
This commit is contained in:
Harald Welte 2018-10-21 10:57:36 +02:00
parent f6c369fb8c
commit 41b6b5e3fc
1 changed files with 2 additions and 0 deletions

View File

@ -144,6 +144,7 @@ static struct node *file_read(void *ctx, const char *fname)
if (indent > cur_indent+1) {
fprintf(stderr, "File '%s' isn't well-formed in line %u, aborting!\n",
fname, line_num);
fclose(infile);
return NULL;
}
/* new child to last node */
@ -166,6 +167,7 @@ static struct node *file_read(void *ctx, const char *fname)
cur_indent = indent;
}
fclose(infile);
return root;
}