summaryrefslogtreecommitdiff
path: root/backport-elf-Fix-use-after-free-in-ldconfig-BZ-26779.patch
blob: ddbeb999c3d8e5abbb89de1d33e48fcc1786e39e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 03ad86880f68f498ee04e9ea84cd4f0d14473970 Mon Sep 17 00:00:00 2001
From: Martin Sebor <msebor@redhat.com>
Date: Tue, 25 Jan 2022 17:37:56 -0700
Subject: [PATCH] elf: Fix use-after-free in ldconfig [BZ #26779]

Conflict:NA
Reference:https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=03ad86880f68f498ee04e9ea84cd4f0d14473970

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
---
 elf/ldconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index d14633f5ec..57bb95ebc3 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -735,9 +735,9 @@ manual_link (char *library)
   create_links (real_path, path, libname, soname);
   free (soname);
 out:
-  free (path);
   if (path != real_path)
     free (real_path);
+  free (path);
 }
 
 
-- 
2.23.0