projects
/
project
/
fstools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1b6811
)
libfstools: make sure file is closed on error
author
Daniel Golle
<daniel@makrotopia.org>
Mon, 30 Aug 2021 19:11:30 +0000
(20:11 +0100)
committer
Daniel Golle
<daniel@makrotopia.org>
Mon, 1 Nov 2021 16:13:29 +0000
(16:13 +0000)
Coverity CID:
1330286
Resource leak
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
libfstools/common.c
patch
|
blob
|
history
diff --git
a/libfstools/common.c
b/libfstools/common.c
index c4847766a0389a444b2dab39c2c14a0574587d97..8dc109537a195c0476a5c02cc2eb4391157ff477 100644
(file)
--- a/
libfstools/common.c
+++ b/
libfstools/common.c
@@
-36,8
+36,10
@@
char
if (!f)
return NULL;
- if (fgets(buf, bufsz, f) == NULL)
+ if (fgets(buf, bufsz, f) == NULL) {
+ fclose(f);
return NULL;
+ }
fclose(f);