[sane-devel] Bug in net.c sane_exit
George Garvey
tmwg-sane at inxservices.com
Fri Feb 21 00:14:51 GMT 2003
Doesn't set global variables to NULL. Then another sane_init uses
invalid pointers when reading the config file, and the next sane_exit
seg faults.
I don't know if the second patch is necessary. Only first_device gave
me troubles.
Index: inX.8/backend/net.c
--- inX.8/backend/net.c Wed, 12 Feb 2003 13:42:12 -0800 tmwg (sane-backends/f/50_net.c 1.1 640)
+++ inX.8(w)/backend/net.c Thu, 20 Feb 2003 15:00:11 -0800 tmwg (sane-backends/f/50_net.c 1.1 640)
@@ -578,6 +578,7 @@ sane_exit (void)
free ((void *) dev->name);
free (dev);
}
+ first_device = 0;
if (devlist)
{
for (i = 0; devlist[i]; ++i)
@@ -591,6 +592,7 @@ sane_exit (void)
free ((void *) devlist[i]);
}
free (devlist);
+ devlist = 0;
}
DBG (3, "sane_exit: finished.\n");
}
More information about the sane-devel
mailing list