Skip to content

Commit

Permalink
Merge pull request #1652 from taosdata/enhance/sdbWal
Browse files Browse the repository at this point in the history
potential memory leak if no any wal files
  • Loading branch information
guanshengliang committed Apr 18, 2020
2 parents 9c63d0a + 3640f93 commit 728881a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wal/src/walMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, void *, int))
}
}

closedir(dir);

if (count == 0) {
if (pWal->keep) code = walRenew(pWal);
return code;
Expand Down Expand Up @@ -248,8 +250,6 @@ int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, void *, int))
}
}

closedir(dir);

return code;
}

Expand Down

0 comments on commit 728881a

Please sign in to comment.