Subject: free_plist missing in pkg_install/add/perform.c
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 04/01/2004 20:06:34
During a package replace using pkg_add, it checks if the new (to be
installed) version is okay for all the packages already using it.

But it is missing a free_plist in the loop so it does the same check
increased each time.

For example (where the depC line is my own extra debugging):

depC is /var/db/pkg/xfce4-panel-4.0.4nb1/+CONTENTS
@pkgdep check: libxml2-2.6.8 is ok for libxml2>=2.6.2 (in
xfce4-panel-4.0.4nb1 pkg)
depC is /var/db/pkg/xfce4-desktop-4.0.4nb1/+CONTENTS
@pkgdep check: libxml2-2.6.8 is ok for libxml2>=2.6.2 (in
xfce4-desktop-4.0.4nb1 pkg)
@pkgdep check: libxml2-2.6.8 is ok for libxml2>=2.6.2 (in
xfce4-desktop-4.0.4nb1 pkg)
depC is /var/db/pkg/xfce4-artwork-0.0.4nb4/+CONTENTS
@pkgdep check: libxml2-2.6.8 is ok for libxml2>=2.6.2 (in
xfce4-artwork-0.0.4nb4 pkg)
@pkgdep check: libxml2-2.6.8 is ok for libxml2>=2.6.2 (in
xfce4-artwork-0.0.4nb4 pkg)
@pkgdep check: libxml2-2.6.8 is ok for libxml2>=2.6.2 (in
xfce4-artwork-0.0.4nb4 pkg)

at that point it does same check three times.

It slowly adds up to be 40+ times!

It is easy to see when using the -v switch.

This appears to work for me:

Index: add/perform.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/pkg_install/add/perform.c,v
retrieving revision 1.95
diff -b -u -r1.95 perform.c
--- add/perform.c	29 Mar 2004 21:41:39 -0000	1.95
+++ add/perform.c	2 Apr 2004 04:03:27 -0000
@@ -469,6 +469,7 @@
 									}
 								}
 							}
+							free_plist(&depPlist);
 						}
 						fclose(rb);



Please let me know if I may commit this.

   Jeremy C. Reed
   http://bsd.reedmedia.net/