<p>I use rpmReadPackageFile() to get RPM headers then use headerGetString() and headerIsSource() during the lifetime of the program.  At the end, I call headerFree() on the RPM headers I read in at the beginning but these are not freed because the reference counts are at 67.  I see headerUnlink() is not available directly, so I don't know what I'm doing incorrectly.  The program itself functions but it's leaking memory at the end.</p>
<p>Do headerGetString() and headerIsSource() increment the reference count?  Looking at the lib/ source, I don't see that obviously standing out.  I only see headerLink() doing and it's not called from many places.</p>
<p>I've modified my local librpm and have it dumping the Header nrefs count.  When I call rpmReadPackageFile(), that reference count becomes 1.  At the end of the program when I call headerFree(), it's 67.  What is the correct way to read a header and not have the reference count grow?  Thanks.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/issues/1072?email_source=notifications&email_token=ADLPZU6RLZNRJGCXKCJQXU3RC3QH3A5CNFSM4KVNRJK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INUWYKQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZU6F4LYJ6B7VI67E7H3RC3QH3ANCNFSM4KVNRJKQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ADLPZU5VIMOSBWA7UQ3SHSLRC3QH3A5CNFSM4KVNRJK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INUWYKQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/rpm-software-management/rpm/issues/1072?email_source=notifications\u0026email_token=ADLPZU6RLZNRJGCXKCJQXU3RC3QH3A5CNFSM4KVNRJK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INUWYKQ",
"url": "https://github.com/rpm-software-management/rpm/issues/1072?email_source=notifications\u0026email_token=ADLPZU6RLZNRJGCXKCJQXU3RC3QH3A5CNFSM4KVNRJK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INUWYKQ",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>