aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/undo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/undo.c b/src/undo.c
index af233e44..0a6a87c0 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -589,9 +589,10 @@ void undo_insert_text_cb(GtkTextBuffer *textbuf, GtkTextIter *iter,
pos = gtk_text_iter_get_offset(iter);
- Xstrndup_a(text_to_insert, new_text, new_text_length, return);
+ text_to_insert = g_strndup(new_text, new_text_length);
undo_add(text_to_insert, pos, pos + g_utf8_strlen(text_to_insert, -1),
UNDO_ACTION_INSERT, undostruct);
+ g_free(text_to_insert);
}
void undo_delete_text_cb(GtkTextBuffer *textbuf, GtkTextIter *start,