From: David Herrmann Date: Thu, 28 Aug 2014 10:25:58 +0000 (+0200) Subject: terminal: free sysview-device names on destruction X-Git-Tag: v217~727 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=fa9838ddd62ea31f8aea99757916a16d76b31cbc terminal: free sysview-device names on destruction Don't leak the device-names during device destruction in sysview. Somehow, the device-name is "const char*", so make it "char*" first to avoid warnings when calling free() on it. --- diff --git a/src/libsystemd-terminal/sysview-internal.h b/src/libsystemd-terminal/sysview-internal.h index 5aee9f67d..9299fabb8 100644 --- a/src/libsystemd-terminal/sysview-internal.h +++ b/src/libsystemd-terminal/sysview-internal.h @@ -39,7 +39,7 @@ struct sysview_device { sysview_seat *seat; - const char *name; + char *name; unsigned int type; union { diff --git a/src/libsystemd-terminal/sysview.c b/src/libsystemd-terminal/sysview.c index f5363dedf..bd345fa22 100644 --- a/src/libsystemd-terminal/sysview.c +++ b/src/libsystemd-terminal/sysview.c @@ -98,6 +98,7 @@ sysview_device *sysview_device_free(sysview_device *device) { break; } + free(device->name); free(device); return NULL;