mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
perl: Free array on error path to avoid leak (RHBZ#1536765).
This commit is contained in:
@@ -122,8 +122,10 @@ XS_unpack_charPtrPtr (SV *arg) {
|
||||
for (i = 0; i <= av_len (av); i++) {
|
||||
SV **elem = av_fetch (av, i, 0);
|
||||
|
||||
if (!elem || !*elem)
|
||||
if (!elem || !*elem) {
|
||||
free (ret);
|
||||
croak (\"missing element in list\");
|
||||
}
|
||||
|
||||
ret[i] = SvPV_nolen (*elem);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user