|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
From 41c7bce9cde89f981b7e82e5a0d5e49e321088fa Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
Date: Fri, 15 May 2015 13:26:18 -0300
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
Subject: [PATCH] timedate: fix memory leak in timedated
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
$ /usr/lib/systemd/systemd-timedated (wait until auto-exit)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
=================================================================
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
==396==ERROR: LeakSanitizer: detected memory leaks
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
Direct leak of 928 byte(s) in 1 object(s) allocated from:
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#0 0x7f782f788db1 in __interceptor_calloc (/usr/lib64/libasan.so.2+0x96db1)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#1 0x562a83ae60cf in bus_message_from_header src/libsystemd/sd-bus/bus-message.c:480
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#2 0x562a83ae6f5a in bus_message_from_malloc src/libsystemd/sd-bus/bus-message.c:576
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#3 0x562a83ad3cad in bus_socket_make_message src/libsystemd/sd-bus/bus-socket.c:915
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#4 0x562a83ad4cfc in bus_socket_read_message src/libsystemd/sd-bus/bus-socket.c:1051
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#5 0x562a83ab733f in bus_read_message src/libsystemd/sd-bus/sd-bus.c:1647
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#6 0x562a83ab98ea in sd_bus_call src/libsystemd/sd-bus/sd-bus.c:2038
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#7 0x562a83b1f46d in sd_bus_call_method src/libsystemd/sd-bus/bus-convenience.c:94
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#8 0x562a83aab3e1 in context_read_ntp src/timedate/timedated.c:192
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#9 0x562a83aae1af in main src/timedate/timedated.c:730
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#10 0x7f782eb238c4 in __libc_start_main (/lib64/libc.so.6+0x208c4)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
Indirect leak of 77 byte(s) in 1 object(s) allocated from:
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#0 0x7f782f788f6a in realloc (/usr/lib64/libasan.so.2+0x96f6a)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#1 0x562a83ad418a in bus_socket_read_message src/libsystemd/sd-bus/bus-socket.c:963
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#2 0x562a83ab733f in bus_read_message src/libsystemd/sd-bus/sd-bus.c:1647
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#3 0x562a83ab98ea in sd_bus_call src/libsystemd/sd-bus/sd-bus.c:2038
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#4 0x562a83b1f46d in sd_bus_call_method src/libsystemd/sd-bus/bus-convenience.c:94
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#5 0x562a83aab3e1 in context_read_ntp src/timedate/timedated.c:192
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#6 0x562a83aae1af in main src/timedate/timedated.c:730
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#7 0x7f782eb238c4 in __libc_start_main (/lib64/libc.so.6+0x208c4)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
Indirect leak of 2 byte(s) in 1 object(s) allocated from:
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#0 0x7f782f75493f in strdup (/usr/lib64/libasan.so.2+0x6293f)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#1 0x562a83b0229b in bus_message_parse_fields src/libsystemd/sd-bus/bus-message.c:5382
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#2 0x562a83ae7290 in bus_message_from_malloc src/libsystemd/sd-bus/bus-message.c:601
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#3 0x562a83ad3cad in bus_socket_make_message src/libsystemd/sd-bus/bus-socket.c:915
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#4 0x562a83ad4cfc in bus_socket_read_message src/libsystemd/sd-bus/bus-socket.c:1051
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#5 0x562a83ab733f in bus_read_message src/libsystemd/sd-bus/sd-bus.c:1647
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#6 0x562a83ab98ea in sd_bus_call src/libsystemd/sd-bus/sd-bus.c:2038
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#7 0x562a83b1f46d in sd_bus_call_method src/libsystemd/sd-bus/bus-convenience.c:94
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#8 0x562a83aab3e1 in context_read_ntp src/timedate/timedated.c:192
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#9 0x562a83aae1af in main src/timedate/timedated.c:730
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
#10 0x7f782eb238c4 in __libc_start_main (/lib64/libc.so.6+0x208c4)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
SUMMARY: AddressSanitizer: 1007 byte(s) leaked in 3 allocation(s).
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
This is due to missing _cleanup_bus_message_unref_ in context_read_ntp()
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
(cherry picked from commit 6b71bab08dc6c92156263daba0e969313eed1323)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
src/timedate/timedated.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
index f2d23f34b1..5ea6e654dc 100644
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
--- a/src/timedate/timedated.c
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
+++ b/src/timedate/timedated.c
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
@@ -188,7 +188,7 @@ static int context_write_data_local_rtc(Context *c) {
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
static int context_read_ntp(Context *c, sd_bus *bus) {
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
- sd_bus_message *reply = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
const char *s;
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
int r;
|
|
Zbigniew Jędrzejewski-Szmek |
a48f80 |
|