diff --git a/bridge/monitor.c b/bridge/monitor.c index e96fcaf7..76e7d477 100644 --- a/bridge/monitor.c +++ b/bridge/monitor.c @@ -132,12 +132,15 @@ int do_monitor(int argc, char **argv) if (file) { FILE *fp; + int err; fp = fopen(file, "r"); if (fp == NULL) { perror("Cannot fopen"); exit(-1); } - return rtnl_from_file(fp, accept_msg, stdout); + err = rtnl_from_file(fp, accept_msg, stdout); + fclose(fp); + return err; } if (rtnl_open(&rth, groups) < 0)