summaryrefslogtreecommitdiff
path: root/src/fe-text/textbuffer-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-text/textbuffer-view.c')
-rw-r--r--src/fe-text/textbuffer-view.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c
index 77b21a2e..8eddae2f 100644
--- a/src/fe-text/textbuffer-view.c
+++ b/src/fe-text/textbuffer-view.c
@@ -268,11 +268,13 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
if (rec->count > 1) {
for (pos = 0; lines != NULL; pos++) {
- memcpy(&rec->lines[pos], lines->data,
+ void *data = lines->data;
+
+ memcpy(&rec->lines[pos], data,
sizeof(LINE_CACHE_SUB_REC));
- g_free(lines->data);
- lines = g_slist_remove(lines, lines->data);
+ lines = g_slist_remove(lines, data);
+ g_free(data);
}
}