diff options
| author | Christian Hesse | 2015-10-09 14:55:50 +0200 |
|---|---|---|
| committer | Jason A. Donenfeld | 2015-10-09 15:50:34 +0200 |
| commit | 08a2b818f2bd3221a1685c28c62408d57b0993a7 (patch) | |
| tree | 412c1cd43932ac44ff03f932cbe7c61c39835a4d | |
| parent | 979db79a80f1926c677691b68eb22b4852a77b50 (diff) | |
| download | cgit-08a2b818f2bd3221a1685c28c62408d57b0993a7.tar.gz cgit-08a2b818f2bd3221a1685c28c62408d57b0993a7.tar.bz2 cgit-08a2b818f2bd3221a1685c28c62408d57b0993a7.zip | |
ui-plain: fix resource leak: free before assigning NULL
Coverity-id: 13939
Signed-off-by: Christian Hesse <mail@eworm.de>
| -rw-r--r-- | ui-plain.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -84,8 +84,10 @@ static void print_dir(const unsigned char *sha1, const char *base, | |||
| 84 | slash = strrchr(fullpath, '/'); | 84 | slash = strrchr(fullpath, '/'); |
| 85 | if (slash) | 85 | if (slash) |
| 86 | *(slash + 1) = 0; | 86 | *(slash + 1) = 0; |
| 87 | else | 87 | else { |
| 88 | free(fullpath); | ||
| 88 | fullpath = NULL; | 89 | fullpath = NULL; |
| 90 | } | ||
| 89 | html("<li>"); | 91 | html("<li>"); |
| 90 | cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.sha1, | 92 | cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.sha1, |
| 91 | fullpath); | 93 | fullpath); |
