From 22c44d49c74e48914bed89d8526af30ab43e1700 Mon Sep 17 00:00:00 2001 From: Vincent Douillet Date: Thu, 26 Dec 2024 16:01:55 +0100 Subject: browse: fix memory leak --- file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'file.c') 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, '/'); -- cgit v1.2.3