aboutsummaryrefslogtreecommitdiff
path: root/src/window
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-27 02:54:36 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-27 02:54:36 +0100
commitf43d6e82c3fb59f25189c745c5ca5ff1d2e3c161 (patch)
tree1090c4908aaf4a55643a19ca5d93b8434198dafb /src/window
parent1dcf4386daded816ea68e39ed8e22903420380d5 (diff)
mgl_window_get_clipboard_string set ptr to NULL after free when failing
Diffstat (limited to 'src/window')
-rw-r--r--src/window/window.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/window/window.c b/src/window/window.c
index 5ae4d3f..709f4b1 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -1221,6 +1221,7 @@ bool mgl_window_get_clipboard_string(mgl_window *self, char **str, size_t *size)
const bool success = mgl_window_get_clipboard(self, clipboard_copy_string_callback, &callback_data, MGL_CLIPBOARD_TYPE_STRING);
if(!success) {
free(*str);
+ *str = NULL;
*size = 0;
}
return success;