summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--browse.c1
-rw-r--r--file.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/browse.c b/browse.c
index b8a90d5..6cd0fd6 100644
--- a/browse.c
+++ b/browse.c
@@ -234,6 +234,7 @@ file_template_callback(size_t index, void *arg)
break;
}
K_OK(khtml_puts(html, basename), r);
+ free(basename);
break;
case 2:
/* url */
diff --git a/file.c b/file.c
index efa581d..52622da 100644
--- a/file.c
+++ b/file.c
@@ -138,7 +138,7 @@ file_get_basename(const struct file * f)
/* is the path a basename itself? */
if (strrchr(f->path, '/') == NULL)
- return f->path;
+ return strdup(f->path);
/* get the basename */
return str_tail(f->path, '/');