aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs13
1 files changed, 3 insertions, 10 deletions
diff --git a/URPM.xs b/URPM.xs
index 63c2671..3f1166d 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -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);