Преглед изворни кода

Revert "libdpkg: Use varbuf_detach instead of ad-hoc code"

This reverts commit 77cae397a15baeca11c26aeb806b6be516e33d5f.

This change introdcued two points for memory leaks, which could be
significant, depending on the amount of calls to the functions.
Guillem Jover пре 16 година
родитељ
комит
7cde255c12
3 измењених фајлова са 3 додато и 3 уклоњено
  1. 1 1
      debian/changelog
  2. 1 1
      lib/dpkg/dbmodify.c
  3. 1 1
      lib/dpkg/fields.c

+ 1 - 1
debian/changelog

@@ -1,6 +1,6 @@
 dpkg (1.15.6.1) UNRELEASED; urgency=low
 
-  *
+  * Fix two memory leaks introduced in 1.15.6.
 
  -- Guillem Jover <guillem@debian.org>  Sat, 13 Mar 2010 05:23:34 +0100
 

+ 1 - 1
lib/dpkg/dbmodify.c

@@ -384,6 +384,6 @@ const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile) {
   varbufaddc(&vb,'.');
   varbufaddstr(&vb,whichfile);
   varbufaddc(&vb,0);
-  return varbuf_detach(&vb);
+  return vb.buf;
 }
 

+ 1 - 1
lib/dpkg/fields.c

@@ -485,7 +485,7 @@ scan_word(const char **valp)
 
   *valp = p;
 
-  return varbuf_detach(&word);
+  return word.buf;
 }
 
 void