mirror of https://github.com/GNOME/gimp.git
xcf-load: g_free name in error cases to avoid leak
In all 3 cases: - xcf_read_string allocates a new string into name. - If an error is detected, we return early - name remains unused. Therefore we add g_free (name) to these early returns to avoid a leak.
This commit is contained in:
parent
76b11a5f69
commit
59eae13aec
|
@ -1954,6 +1954,7 @@ xcf_load_layer (XcfInfo *info,
|
|||
break;
|
||||
|
||||
default:
|
||||
g_free (name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1977,6 +1978,7 @@ xcf_load_layer (XcfInfo *info,
|
|||
}
|
||||
else
|
||||
{
|
||||
g_free (name);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -2830,6 +2832,7 @@ xcf_load_old_path (XcfInfo *info,
|
|||
{
|
||||
g_printerr ("Unknown path type. Possibly corrupt XCF file");
|
||||
|
||||
g_free (name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue