diff options
Diffstat (limited to 'fm.c')
| -rw-r--r-- | fm.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -186,8 +186,10 @@ static char *fm_print_preview_content(window *w, const char *path) { char *buf = xmalloc(sizeof(char) * PATH_MAX); FILE *fp = fopen(path, "r"); - if (!fp) + if (!fp) { + free(buf); die("Cannot open file: %s", path); + } int i = 0; while (fgets(buf, PATH_MAX, fp) != NULL && i < w->height) { |
