diff options
author | Vincent Douillet <vincent@vdouillet.fr> | 2024-10-23 09:01:24 +0200 |
---|---|---|
committer | Vincent Douillet <vincent@vdouillet.fr> | 2024-10-23 09:01:24 +0200 |
commit | 878cd6e8792d5ac03eea59fec9fe8e325440d50c (patch) | |
tree | 1d0bcb85c52daba96d1eb41adca28160bb118fa7 | |
parent | 86ba3c3565208414ddad81c088d2db646fd2d4c8 (diff) |
-rw-r--r-- | browse.c | 2 | ||||
-rw-r--r-- | download.c | 4 | ||||
-rw-r--r-- | file.h | 3 |
3 files changed, 4 insertions, 5 deletions
@@ -370,7 +370,7 @@ browse(struct kreq * r) end: page_template_free(tmpl); if (file != NULL) { - free(file); + file_free(file); file = NULL; } while (!SLIST_EMPTY(&list)) { @@ -172,8 +172,6 @@ download(struct kreq * r) end: if (f != NULL && f->size > 0) munmap(buffer, f->size); - if (f != NULL) - free(f); - + file_free(f); return ret; } @@ -63,7 +63,8 @@ struct file * file_new(const char *); /* - * Get the file basename. + * Get the file basename. Returns NULL in case of error or a malloced string in + * case of success. */ char * file_get_basename(const struct file *); |