diff options
| author | Sam Varshavchik | 2022-02-02 08:17:02 -0500 |
|---|---|---|
| committer | Sam Varshavchik | 2022-02-02 08:17:02 -0500 |
| commit | c02c7c70e57ce07f186862826168fae59df224cc (patch) | |
| tree | 8e259cde28c95a3916062da5aa2099f0df471f42 /imap | |
| parent | 2d77bfdeea48b8af1cbc96c6773d1bafd697cb80 (diff) | |
| download | courier-libs-c02c7c70e57ce07f186862826168fae59df224cc.tar.bz2 | |
Fix minor memory leaks.
Diffstat (limited to 'imap')
| -rw-r--r-- | imap/Makefile.am | 10 | ||||
| -rw-r--r-- | imap/smap.c | 5 | ||||
| -rw-r--r-- | imap/testsuitevalgrind | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/imap/Makefile.am b/imap/Makefile.am index 813a977..ea27289 100644 --- a/imap/Makefile.am +++ b/imap/Makefile.am @@ -219,16 +219,16 @@ check-am: LC_ALL=C; export LC_ALL; test "@smap@" = "yes" || exit 0; @SHELL@ $(srcdir)/smaptestsuite | ./testsuitefix.pl | sort | cmp -s - $(srcdir)/smaptestsuite.txt VALGRIND="`which valgrind 2>/dev/null`"; test "$$VALGRIND" != "" || exit 0; \ LC_ALL=C; export LC_ALL; \ - rm -f confmdtesterror; \ + rm -f confmdmemleak; \ IMAPINVOKE='@SHELL@ $(srcdir)/testsuitevalgrind ./imapd'; export IMAPINVOKE; \ - @SHELL@ -x $(srcdir)/testsuite 2>&1 | tee confmderror.txt; test -f confmdtesterror || exit 0; exit 1 + @SHELL@ -x $(srcdir)/testsuite 2>&1 | tee confmderror.txt; test -f confmdmemleak || exit 0; exit 1 VALGRIND="`which valgrind 2>/dev/null`"; test "$$VALGRIND" != "" || exit 0; \ LC_ALL=C; export LC_ALL; \ - rm -f confmdtesterror; \ + rm -f confmdmemleak; \ IMAPINVOKE='@SHELL@ $(srcdir)/testsuitevalgrind ./imapd'; export IMAPINVOKE; \ - @SHELL@ -x $(srcdir)/smaptestsuite 2>&1 | tee confmderror.txt; test -f confmdtesterror || exit 0; exit 1 + @SHELL@ -x $(srcdir)/smaptestsuite 2>&1 | tee confmderror.txt; test -f confmdmemleak || exit 0; exit 1 - rm -f confmdtesterror confmderror.txt + rm -f confmderror.txt rm -rf confmdtest testsuite-imap: diff --git a/imap/smap.c b/imap/smap.c index 450e2dc..c0334ea 100644 --- a/imap/smap.c +++ b/imap/smap.c @@ -3763,6 +3763,7 @@ void smap() if (strchr(rights_buf, ACL_LOOKUP[0]) == NULL) { + free(t); accessdenied(ACL_LOOKUP); continue; } @@ -3782,6 +3783,7 @@ void smap() if (imapscan_maildir(infoptr, t, 1, 1, NULL)) { + free(t); writes("-ERR Cannot read" " folder status: "); writes(strerror(errno)); @@ -3789,6 +3791,7 @@ void smap() continue; } } + free(t); writes("* STATUS EXISTS="); writen(infoptr->nmessages+infoptr->left_unseen); @@ -4084,6 +4087,8 @@ void smap() { writes("+OK Folder renamed.\n"); } + maildir_smapfn_free(fnsrc); + maildir_smapfn_free(fndst); maildir_info_destroy(&msrc); maildir_info_destroy(&mdst); continue; diff --git a/imap/testsuitevalgrind b/imap/testsuitevalgrind index e39c463..90735d2 100644 --- a/imap/testsuitevalgrind +++ b/imap/testsuitevalgrind @@ -1,5 +1,5 @@ #! /bin/bash valgrind --tool=memcheck --leak-check=yes --error-exitcode=1 "$@" && exit 0 ->confmdtesterror +>confmdmemleak exit 0 |
