summaryrefslogtreecommitdiffstats
path: root/save-html.c
diff options
context:
space:
mode:
Diffstat (limited to 'save-html.c')
-rw-r--r--save-html.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/save-html.c b/save-html.c
index 0288d447c..82d81edda 100644
--- a/save-html.c
+++ b/save-html.c
@@ -16,7 +16,9 @@ void save_photos(struct membuffer *b, const char *photos_dir, struct dive *dive)
struct picture *pic = dive->picture_list;
put_string(b, "\"photos\":[");
while (pic) {
- put_format(b, "{\"filename\":\"%s\"},", get_file_name(pic->filename));
+ char *fname = get_file_name(pic->filename);
+ put_format(b, "{\"filename\":\"%s\"},", fname);
+ free(fname);
copy_image_and_overwrite(pic->filename, photos_dir);
pic = pic->next;
}