mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-06 15:20:12 +00:00
gpsd: Backport a memory leak fix
Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
From 2a4b3bcde0d73a3a4a6644d5f944ac9d16023ba9 Mon Sep 17 00:00:00 2001
|
||||
From: Adrian Bunk <bunk@stusta.de>
|
||||
Date: Mon, 21 Oct 2019 13:53:25 +0300
|
||||
Subject: gps_shm_close: Free privdata
|
||||
|
||||
Previously every open/close cycle leaked privdata.
|
||||
|
||||
Signed-off-by: Adrian Bunk <bunk@stusta.de>
|
||||
Signed-off-by: Gary E. Miller <gem@rellim.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
---
|
||||
libgps_shm.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libgps_shm.c b/libgps_shm.c
|
||||
index d93972bba..12bb3760b 100644
|
||||
--- a/libgps_shm.c
|
||||
+++ b/libgps_shm.c
|
||||
@@ -163,8 +163,12 @@ int gps_shm_read(struct gps_data_t *gpsdata)
|
||||
|
||||
void gps_shm_close(struct gps_data_t *gpsdata)
|
||||
{
|
||||
- if (PRIVATE(gpsdata) && PRIVATE(gpsdata)->shmseg != NULL)
|
||||
- (void)shmdt((const void *)PRIVATE(gpsdata)->shmseg);
|
||||
+ if (PRIVATE(gpsdata)) {
|
||||
+ if (PRIVATE(gpsdata)->shmseg != NULL)
|
||||
+ (void)shmdt((const void *)PRIVATE(gpsdata)->shmseg);
|
||||
+ free(PRIVATE(gpsdata));
|
||||
+ gpsdata->privdata = NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
int gps_shm_mainloop(struct gps_data_t *gpsdata, int timeout,
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -9,6 +9,7 @@ EXTRANATIVEPATH += "chrpath-native"
|
||||
|
||||
SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
|
||||
file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \
|
||||
file://0001-gps_shm_close-Free-privdata.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "b3bf88706794eb8e5f2c2543bf7ba87b"
|
||||
SRC_URI[sha256sum] = "27dd24d45b2ac69baab7933da2bf6ae5fb0be90130f67e753c110a3477155f39"
|
||||
|
||||
Reference in New Issue
Block a user