bfa61b1673
* Updated pci.ids to the today's snapshot of the database. * Fixed memory and file descriptor leak in the dump back-end. * The SR-IOV capability decoder now prints the VF BAR's. * On request of certain company's lawyers, we now include a copy of the GPL with our package. It seems that the pciutils are getting mature if the most important bug of the month was this one ;-) OBS-URL: https://build.opensuse.org/package/show/Base:System/pciutils?expand=0&rev=10
42 lines
875 B
Diff
42 lines
875 B
Diff
--- lib/dump.c
|
|
+++ lib/dump.c
|
|
@@ -70,7 +70,10 @@
|
|
{
|
|
char *z = strchr(buf, '\n');
|
|
if (!z)
|
|
- a->error("dump: line too long or unterminated");
|
|
+ {
|
|
+ fclose(f);
|
|
+ a->error("dump: line too long or unterminated");
|
|
+ }
|
|
*z-- = 0;
|
|
if (z >= buf && *z == '\r')
|
|
*z-- = 0;
|
|
@@ -95,7 +98,10 @@
|
|
sscanf(z, "%x", &j) == 1 && j < 256)
|
|
{
|
|
if (i >= 4096)
|
|
- a->error("dump: At most 4096 bytes of config space are supported");
|
|
+ {
|
|
+ fclose(f);
|
|
+ a->error("dump: At most 4096 bytes of config space are supported");
|
|
+ }
|
|
if (i >= dd->allocated) /* Need to re-allocate the buffer */
|
|
{
|
|
dump_alloc_data(dev, 4096);
|
|
@@ -111,9 +117,13 @@
|
|
z++;
|
|
}
|
|
if (*z)
|
|
- a->error("dump: Malformed line");
|
|
+ {
|
|
+ fclose(f);
|
|
+ a->error("dump: Malformed line");
|
|
+ }
|
|
}
|
|
}
|
|
+ fclose(f);
|
|
}
|
|
|
|
static void
|