linux-atm/linux-atm-2.5.0-fdleak.patch

23 lines
578 B
Diff
Raw Normal View History

Index: src/arpd/atmarp.c
===================================================================
--- src/arpd/atmarp.c.orig 2009-10-10 01:49:14.000000000 +0200
+++ src/arpd/atmarp.c 2009-10-10 01:51:34.000000000 +0200
@@ -90,14 +90,17 @@ static int print_table(void)
}
while ((size = read(fd,buffer,BUF_SIZE))) {
if (size < 0) {
+ close(fd);
perror("read " ATMARP_DUMP_DIR "/" ATMARP_DUMP_FILE);
return 1;
}
if (write(0,buffer,size) < 0) {
+ close(fd);
perror("write stdout");
return 1;
}
}
+ close(fd);
return 0;
}