]> git.pld-linux.org Git - packages/libnet.git/blobdiff - libnet-leaking-fd.patch
- 1.1.6
[packages/libnet.git] / libnet-leaking-fd.patch
index 0a8b9be7cc7e1064ef2236213aab06302411d615..397ed3ca9aa5d9e9d9ddf1ff7388d93af8111673 100644 (file)
@@ -8,47 +8,6 @@
        return (-1);
      }
  #endif
-@@ -154,6 +155,10 @@
-       snprintf(errbuf, LIBNET_ERRBUF_SIZE,
-                 "%s(): ioctl(SIOCGIFCONF) error: %s\n", 
-                 __func__, strerror(errno));
-+      close(fd);
-+#ifdef HAVE_LINUX_PROCFS
-+      fclose(fp);
-+#endif
-       return(-1);
-     }
-@@ -213,7 +218,7 @@
-             pifr = ifr;
-             continue;
-       }
--      
-+
-         strncpy(nifr.ifr_name, device, sizeof(device) - 1);
-         nifr.ifr_name[sizeof(nifr.ifr_name) - 1] = '\0';
-         if (ioctl(fd, SIOCGIFADDR, (int8_t *)&nifr) < 0)
-@@ -224,6 +229,9 @@
-                         "%s(): SIOCGIFADDR: dev=%s: %s\n", __func__, device,
-                         strerror(errno));
-                 close(fd);
-+#ifdef HAVE_LINUX_PROCFS
-+                fclose(fp);
-+#endif
-                 return (-1);
-           }
-             else /* device has no IP address => set to 0 */
-@@ -240,6 +248,10 @@
-         {
-             snprintf(errbuf, LIBNET_ERRBUF_SIZE, 
-                     "%s(): strdup not enough memory\n", __func__);
-+            close(fd);
-+#ifndef HAVE_LINUX_PROCFS
-+            fclose(fp);
-+#endif
-             return(-1);
-         }
 @@ -251,7 +263,9 @@
  #endif
  
This page took 0.094529 seconds and 4 git commands to generate.