The following commit has been merged in the master branch: commit b03ae3024d1e1e7f66afeaa8f2e2638336088c8d Author: Guillem Jover <[EMAIL PROTECTED]> Date: Wed Jun 4 06:26:16 2008 +0300
dpkg: Fix memory leaks if archivefiles is called more than once Use varbufreset instead of varbufinit, as the variables are global. diff --git a/ChangeLog b/ChangeLog index 2e93770..b683f06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-06-04 Guillem Jover <[EMAIL PROTECTED]> + * src/archives.c (archivefiles): Use varbufreset instead of varbufinit + to avoid possible leaks if this function is called more than once. + +2008-06-04 Guillem Jover <[EMAIL PROTECTED]> + * lib/log.c (log_message): Switch log from a pointer to struct varbuf to just struct varbuf. diff --git a/src/archives.c b/src/archives.c index 5124e1f..a202244 100644 --- a/src/archives.c +++ b/src/archives.c @@ -1173,9 +1173,11 @@ void archivefiles(const char *const *argv) { currenttime = time(NULL); - varbufinit(&fnamevb); - varbufinit(&fnametmpvb); - varbufinit(&fnamenewvb); + /* Initialize fname variables contents. */ + + varbufreset(&fnamevb); + varbufreset(&fnametmpvb); + varbufreset(&fnamenewvb); varbufaddstr(&fnamevb,instdir); varbufaddc(&fnamevb,'/'); varbufaddstr(&fnametmpvb,instdir); varbufaddc(&fnametmpvb,'/'); -- dpkg's main repository -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]