diff options
author | Yorhel <git@yorhel.nl> | 2013-06-03 17:32:46 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2013-06-03 17:32:46 +0200 |
commit | 0b51247c93aac72c29657807640e11388b6f706a (patch) | |
tree | 5a2d82b3b784c20077a3bf7ff0934f40195aeab8 | |
parent | f5ffccfaa8303e814f65bac49aa59657d65f1971 (diff) |
share/scan: Fix memory leak and an if condition bug
-rw-r--r-- | src/share/scan.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/share/scan.c b/src/share/scan.c index 4d29f4b..5784ff1 100644 --- a/src/share/scan.c +++ b/src/share/scan.c @@ -138,7 +138,7 @@ static share_fl_t *share_scan_thread_item(share_scan_work_t *w, const char *fnam } fl = share_fl_create(S_ISDIR(st.st_mode) ? UINT64_MAX : (uint64_t)st.st_size, fname, buf); - if(fl->size == UINT64_MAX) { + if(fl->size != UINT64_MAX) { fl->lastmod = st.st_mtime; fl->pathid = w->pathid; } @@ -175,6 +175,7 @@ static share_flv_t share_scan_thread_readdir(share_scan_work_t *w) { ywarn("Error reading file list from '%s': %s", w->fspath, strerror(olderrno ? olderrno : errno)); } + free(buf.s); return lst; } |