diff options
author | Thierry Vignaud <tv@mandriva.org> | 2006-11-29 15:36:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2006-11-29 15:36:27 +0000 |
commit | 8a3c7b3be201f1faf0f2dcd3d9882018c9425261 (patch) | |
tree | a16ab2087e2a64211e30a3bfe810cd384128dc5d | |
parent | 4ee19d4705bd5ef81c0cd1b9681cfca913bae90f (diff) | |
download | perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.tar perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.tar.gz perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.tar.bz2 perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.tar.xz perl-URPM-8a3c7b3be201f1faf0f2dcd3d9882018c9425261.zip |
(Trans_add) fix the segfault when using --excludepath (introduced in
r32435:32440). however, using --excludepath will still segfaults, but
later, in rpmtsAddInstallElement() ...
-rw-r--r-- | URPM.xs | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -2669,7 +2669,11 @@ Trans_add(trans, pkg, ...) CODE: if ((pkg->flag & FLAG_ID) <= FLAG_ID_MAX && pkg->h != NULL) { int update = 0; +#ifdef RPM_446 + rpmRelocation relocations = NULL; +#else rpmRelocation *relocations = NULL; +#endif /* compability mode with older interface of add */ if (items == 3) { update = SvIV(ST(2)); @@ -2689,19 +2693,14 @@ Trans_add(trans, pkg, ...) while (--j >= 0) { SV **e = av_fetch(excludepath, j, 0); if (e != NULL && *e != NULL) { -#ifdef RPM_446 - rpmRelocation relptr = relocations[j]; - relptr->oldPath = SvPV_nolen(*e); -#else relocations[j].oldPath = SvPV_nolen(*e); -#endif } } } } } } - RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(pkg->flag & FLAG_ID)), update, *relocations) == 0; + RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(pkg->flag & FLAG_ID)), update, relocations) == 0; /* free allocated memory, check rpm is copying it just above, at least in 4.0.4 */ free(relocations); } else RETVAL = 0; |