mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 22:45:21 +00:00
storage: Need to also VIR_FREE(reg)
Commit-id 'afc4631b' added the regfree(reg) to free resources alloc'd during regcomp; however, reg still needed to be VIR_FREE()'d. The call to regfree() also didn't account for possible NULL value. Reformatted the call to be closer to usage. (cherry picked from commit71da3b66a8
) Backported to 0.9.12 withafc4631b
and its revert skipped. Signed-off-by: Luca Tettamanti <ltettamanti acunu com>
This commit is contained in:
parent
6a3787f98f
commit
3afbdfc3c4
@ -204,13 +204,16 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool,
|
|||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
char error[100];
|
char error[100];
|
||||||
regerror(err, reg, error, sizeof(error));
|
regerror(err, reg, error, sizeof(error));
|
||||||
|
regfree(reg);
|
||||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Failed to compile regex %s"),
|
_("Failed to compile regex %s"),
|
||||||
error);
|
error);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (regexec(reg, groups[3], nvars, vars, 0) != 0) {
|
err = regexec(reg, groups[3], nvars, vars, 0);
|
||||||
|
regfree(reg);
|
||||||
|
if (err != 0) {
|
||||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("malformed volume extent devices value"));
|
_("malformed volume extent devices value"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user