|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From fa9838ddd62ea31f8aea99757916a16d76b31cbc Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 28 Aug 2014 12:25:58 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal: free sysview-device names on destruction
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Don't leak the device-names during device destruction in sysview. Somehow,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
the device-name is "const char*", so make it "char*" first to avoid
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
warnings when calling free() on it.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/sysview-internal.h | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/sysview.c | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
2 files changed, 2 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/sysview-internal.h b/src/libsystemd-terminal/sysview-internal.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 5aee9f67d8..9299fabb82 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/sysview-internal.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/sysview-internal.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -39,7 +39,7 @@
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
struct sysview_device {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
sysview_seat *seat;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- const char *name;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ char *name;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
unsigned int type;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
union {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/sysview.c b/src/libsystemd-terminal/sysview.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index f5363dedf4..bd345fa22e 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/sysview.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/sysview.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -98,6 +98,7 @@ sysview_device *sysview_device_free(sysview_device *device) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
break;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ free(device->name);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
free(device);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return NULL;
|