projects
/
apt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8e11253
)
use FullName and strdup instead of handmade and new[]
author
David Kalnischkies
<kalnischkies@gmail.com>
Mon, 7 Mar 2011 22:06:36 +0000
(23:06 +0100)
committer
David Kalnischkies
<kalnischkies@gmail.com>
Mon, 7 Mar 2011 22:06:36 +0000
(23:06 +0100)
apt-pkg/deb/dpkgpm.cc
patch
|
blob
|
blame
|
history
diff --git
a/apt-pkg/deb/dpkgpm.cc
b/apt-pkg/deb/dpkgpm.cc
index 84443447f3ea3b0f5082e53ca94178778e35becf..7b0955b96bd8390849df74f5474116d4b5fa81d3 100644
(file)
--- a/
apt-pkg/deb/dpkgpm.cc
+++ b/
apt-pkg/deb/dpkgpm.cc
@@
-1003,10
+1003,8
@@
bool pkgDPkgPM::Go(int OutStatusFd)
Args[n++] = I->Pkg.Name();
else
{
Args[n++] = I->Pkg.Name();
else
{
- string const PkgDesc = I->Pkg.Name() + string(":") + string(I->Pkg.Arch());
- Packages[pkgcount] = new char[PkgDesc.size()+1];
- strncpy(Packages[pkgcount++],PkgDesc.c_str(),PkgDesc.size()+1);
- Args[n++] = Packages[pkgcount-1];
+ Packages[pkgcount] = strdup(I->Pkg.FullName(false).c_str());
+ Args[n++] = Packages[pkgcount++];
}
Size += strlen(Args[n-1]);
}
}
Size += strlen(Args[n-1]);
}
@@
-1160,7
+1158,7
@@
bool pkgDPkgPM::Go(int OutStatusFd)
/* clean up the temporary allocation for multiarch package names in
the parent, so we don't leak memory when we return. */
for (unsigned int i = 0; i < pkgcount; i++)
/* clean up the temporary allocation for multiarch package names in
the parent, so we don't leak memory when we return. */
for (unsigned int i = 0; i < pkgcount; i++)
-
delete [] Packages[i]
;
+
free(Packages[i])
;
// the result of the waitpid call
int res;
// the result of the waitpid call
int res;