diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-11-06 17:39:40 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2011-11-06 17:39:40 +0100 |
commit | 9935bcaf175897fa9c0e83462a715995bbc8e451 (patch) | |
tree | 22007edfad3ce977c69bd471c32b2ac6e1275c83 /src | |
parent | 0c645aa0a7d28a30b7f46916987f39d22531aa0a (diff) |
Duplicate filename in image store
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.c | 3 | ||||
-rw-r--r-- | src/objects.c | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c index 524c2e1..1101345 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -1054,8 +1054,7 @@ static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context, p->editing_object = o; redraw_object(o); - /* Don't free "filename" - it's now owned by the - * image store. */ + free(filename); } } diff --git a/src/objects.c b/src/objects.c index 01d603d..f1e9259 100644 --- a/src/objects.c +++ b/src/objects.c @@ -71,7 +71,7 @@ static struct image *add_image_to_store(struct image_store *is, char *filename) is->n_images--; return NULL; } - i_new->filename = filename; + i_new->filename = strdup(filename); i_new->refcount = 1; i_new->width = w; i_new->height = h; |