Fix file descriptor leak on error in iproute_flush_cache()

Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
This commit is contained in:
Thomas Jarosch 2011-10-03 05:23:53 +00:00 committed by Stephen Hemminger
parent e9a927dc08
commit 25352af7c2
1 changed files with 1 additions and 0 deletions

View File

@ -1057,6 +1057,7 @@ static int iproute_flush_cache(void)
if ((write (flush_fd, (void *)buffer, len)) < len) {
fprintf (stderr, "Cannot flush routing cache\n");
close(flush_fd);
return -1;
}
close(flush_fd);