elf: Fix use-after-free in ldconfig [BZ #26779]

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Martin Sebor 2022-01-25 17:37:56 -07:00
parent 342cc934a3
commit 03ad86880f

View File

@ -735,9 +735,9 @@ manual_link (char *library)
create_links (real_path, path, libname, soname); create_links (real_path, path, libname, soname);
free (soname); free (soname);
out: out:
free (path);
if (path != real_path) if (path != real_path)
free (real_path); free (real_path);
free (path);
} }