]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
Fix file descriptor leak on error in iproute_flush_cache()
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 3 Oct 2011 05:23:53 +0000 (05:23 +0000)
committerStephen Hemminger <shemminger@vyatta.com>
Fri, 7 Oct 2011 18:18:09 +0000 (11:18 -0700)
Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
ip/iproute.c

index 21e1a4b0d55a669bf6706bf9aee1fd62de395bee..15b36e8d8873a69b3c8685ac28a02fe406e643d1 100644 (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);