Fix file descriptor leak on error in read_mroute_list()
Detected by cppcheck. Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
This commit is contained in:
parent
67ef60a293
commit
e588a7db16
|
|
@ -85,8 +85,10 @@ static void read_mroute_list(FILE *ofp)
|
|||
if (!fp)
|
||||
return;
|
||||
|
||||
if (!fgets(buf, sizeof(buf), fp))
|
||||
if (!fgets(buf, sizeof(buf), fp)) {
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
||||
while (fgets(buf, sizeof(buf), fp)) {
|
||||
inet_prefix maddr, msrc;
|
||||
|
|
|
|||
Loading…
Reference in New Issue