mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
Free groups in case of a partial match
If there are more than two regexes, but only one of them matches, the matched groups would be leaked.
This commit is contained in:
parent
cf4fb7d9a0
commit
d223cd76c3
@ -2858,10 +2858,10 @@ virCommandRunRegex(virCommandPtr cmd,
|
|||||||
if (i == nregex) {
|
if (i == nregex) {
|
||||||
if (((*func)(groups, data)) < 0)
|
if (((*func)(groups, data)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
for (j = 0; j < totgroups; j++)
|
|
||||||
VIR_FREE(groups[j]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < ngroup; j++)
|
||||||
|
VIR_FREE(groups[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user