From af2a44237a7b5cebbf0d03375ed742809da15a59 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 12 Sep 2011 20:15:10 +0200 Subject: feh_load_image: Do not add file to rm filelist unless it is cached This fixes a "memory leak" (though strictly speaking it is none) when using feh --reload on http URLs. --- src/imlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/imlib.c') diff --git a/src/imlib.c b/src/imlib.c index 45de85c..28ae018 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -151,13 +151,14 @@ int feh_load_image(Imlib_Image * im, feh_file * file) /* Http, no reload, slideshow. Let's keep this image on hand... */ free(file->filename); file->filename = estrdup(tmpname); + + if (!opt.keep_http) + add_file_to_rm_filelist(tmpname); } else { /* Don't cache the image if we're doing reload + http (webcams etc) */ if (!opt.keep_http) unlink(tmpname); } - if (!opt.keep_http) - add_file_to_rm_filelist(tmpname); free(tmpname); } else { *im = imlib_load_image_with_error_return(file->filename, &err); -- cgit v1.2.3