rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, char ** msg))
{
DBC * dbcursor = NULL;
- DBT * key = alloca(sizeof(*key));
- DBT * data = alloca(sizeof(*data));
+ DBT * key;
+ DBT * data;
union _dbswap mi_offset;
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
HFD_t hfd = headerFreeData;
if (db == NULL)
return 0;
- memset(key, 0, sizeof(*key));
- memset(data, 0, sizeof(*data));
+ key = xcalloc(1, sizeof(*key));
+ data = xcalloc(1, sizeof(*data));
{ rpmdbMatchIterator mi;
mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, &hdrNum, sizeof(hdrNum));
if (h == NULL) {
rpmlog(RPMLOG_ERR, _("%s: cannot read header at 0x%x\n"),
"rpmdbRemove", hdrNum);
- return 1;
+ ret = 1;
+ goto exit;
}
{
h = headerFree(h);
/* XXX return ret; */
- return 0;
+ ret = 0;
+
+exit:
+ free(key);
+ free(data);
+ return ret;
}
/* XXX install.c */