Use headerCopy() for, well, copying a header
Most likely wouldn't have worked prior to commit
27ea3f8624
.
This commit is contained in:
parent
91aa0786cf
commit
d90adb4b34
|
@ -474,24 +474,14 @@ static int replaceSignature(Header sigh, sigTarget sigt1, sigTarget sigt2)
|
|||
|
||||
static void unloadImmutableRegion(Header *hdrp, rpmTagVal tag)
|
||||
{
|
||||
struct rpmtd_s copytd, td;
|
||||
struct rpmtd_s td;
|
||||
rpmtd utd = &td;
|
||||
Header nh;
|
||||
Header oh;
|
||||
HeaderIterator hi;
|
||||
|
||||
if (headerGet(*hdrp, tag, utd, HEADERGET_DEFAULT)) {
|
||||
nh = headerNew();
|
||||
oh = headerCopyLoad(utd->data);
|
||||
hi = headerInitIterator(oh);
|
||||
|
||||
while (headerNext(hi, ©td)) {
|
||||
if (copytd.data)
|
||||
headerPut(nh, ©td, HEADERPUT_DEFAULT);
|
||||
rpmtdFreeData(©td);
|
||||
}
|
||||
|
||||
headerFreeIterator(hi);
|
||||
nh = headerCopy(oh);
|
||||
headerFree(oh);
|
||||
rpmtdFreeData(utd);
|
||||
headerFree(*hdrp);
|
||||
|
|
Loading…
Reference in New Issue