diff options
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -3213,12 +3213,8 @@ Urpm_stream2header(fp) if ((fd = fdDup(fileno(fp)))) { pkg = (URPM__Package)calloc(1, sizeof(struct s_Package)); pkg->h = headerRead(fd, HEADER_MAGIC_YES); - if (pkg->h) { - SV *sv_pkg; - sv_pkg = sv_newmortal(); - sv_setref_pv(sv_pkg, "URPM::Package", (void*)pkg); - XPUSHs(sv_pkg); - } + if (pkg->h) + XPUSHs(sv_setref_pv(sv_newmortal(), "URPM::Package", (void*)pkg)); Fclose(fd); } @@ -3237,12 +3233,9 @@ Urpm_spec2srcheader(specfile) spec = rpmSpecParse(specfile, RPMSPEC_ANYARCH|RPMSPEC_FORCE, NULL); if (spec) { header = rpmSpecSourceHeader(spec); - SV *sv_pkg; pkg = (URPM__Package)calloc(1, sizeof(struct s_Package)); pkg->h = headerLink(header); - sv_pkg = sv_newmortal(); - sv_setref_pv(sv_pkg, "URPM::Package", (void*)pkg); - XPUSHs(sv_pkg); + XPUSHs(sv_setref_pv(sv_newmortal(), "URPM::Package", (void*)pkg)); spec = rpmSpecFree(spec); } else { XPUSHs(&PL_sv_undef); |