mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
networkd: Free Prefix in case allocation fails (#7480)
Set the code to call _cleanup_prefix_free_ in case the next allocation fails so that Prefix does not leak memory. Reported by evverx.
This commit is contained in:
committed by
Lennart Poettering
parent
401e33ed56
commit
a86d329f22
@@ -1035,7 +1035,7 @@ void prefix_free(Prefix *prefix) {
|
||||
}
|
||||
|
||||
int prefix_new(Prefix **ret) {
|
||||
Prefix *prefix = NULL;
|
||||
_cleanup_prefix_free_ Prefix *prefix = NULL;
|
||||
|
||||
prefix = new0(Prefix, 1);
|
||||
if (!prefix)
|
||||
|
||||
Reference in New Issue
Block a user