[glib/wip/smcv/address-sanitizer: 27/28] gutils: Tell AddressSanitizer not to track previous XDG directories
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/smcv/address-sanitizer: 27/28] gutils: Tell AddressSanitizer not to track previous XDG directories
- Date: Mon, 1 Feb 2021 11:21:41 +0000 (UTC)
commit 41ed1c6d5db88375ceb5fccf86385419a45eb8ab
Author: Simon McVittie <smcv collabora com>
Date: Thu Jan 28 21:03:13 2021 +0000
gutils: Tell AddressSanitizer not to track previous XDG directories
We reset these in some unit tests, and must deliberately leak them to
avoid having to break API.
Signed-off-by: Simon McVittie <smcv collabora com>
glib/gutils.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/glib/gutils.c b/glib/gutils.c
index 8a5dece33..dad162528 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -1601,6 +1601,7 @@ set_str_if_different (gchar **global_str,
/* We have to leak the old value, as user code could be retaining pointers
* to it. */
+ g_ignore_leak (*global_str);
*global_str = g_strdup (new_value);
}
}
@@ -1619,6 +1620,7 @@ set_strv_if_different (gchar ***global_strv,
/* We have to leak the old value, as user code could be retaining pointers
* to it. */
+ g_ignore_strv_leak (*global_strv);
*global_strv = g_strdupv ((gchar **) new_value);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]