summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f888210)
raw | patch | inline | side by side (parent: f888210)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 16 Feb 2008 13:09:36 +0000 (14:09 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sun, 17 Feb 2008 10:22:19 +0000 (11:22 +0100) |
Else the stack would probably be left in an inconsistent case and might even
leak memory.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
leak memory.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/perl.c | patch | blob | history |
diff --git a/src/perl.c b/src/perl.c
index 3c50528f9f62ebad0360642eac2c1089eaabecc0..7558a50638390fc7918b8d1b60420d14a2f8a3a6 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
ds = va_arg (ap, data_set_t *);
vl = va_arg (ap, value_list_t *);
- if (-1 == data_set2av (aTHX_ ds, pds))
- return -1;
+ if (-1 == data_set2av (aTHX_ ds, pds)) {
+ av_clear (pds);
+ av_undef (pds);
+ pds = Nullav;
+ ret = -1;
+ }
- if (-1 == value_list2hv (aTHX_ vl, ds, pvl))
- return -1;
+ if (-1 == value_list2hv (aTHX_ vl, ds, pvl)) {
+ hv_clear (pvl);
+ hv_undef (pvl);
+ pvl = Nullhv;
+ ret = -1;
+ }
XPUSHs (sv_2mortal (newSVpv (ds->type, 0)));
XPUSHs (sv_2mortal (newRV_noinc ((SV *)pds)));
n = va_arg (ap, notification_t *);
- if (-1 == notification2hv (aTHX_ n, notif))
- return -1;
+ if (-1 == notification2hv (aTHX_ n, notif)) {
+ hv_clear (notif);
+ hv_undef (notif);
+ notif = Nullhv;
+ ret = -1;
+ }
XPUSHs (sv_2mortal (newRV_noinc ((SV *)notif)));
}