# HG changeset patch # User bears # Date 1014743611 0 # Node ID fbff73fe5b4052caae9d58b2c003ae7ba4016153 # Parent 2b7ddb90d9b22a2ae396f8b4e81d5c7a9d93c9f6 [svn] * src/client.c: That wasn't a memory leak fixed on Feb 8th. That was a cockup cause by my forgetting that Cont_app takes ownership of an overview. Revert it and add comment to Cont_app. Spotted with the aid of valgrind. * src/post.c,src/pseudo.c * src/util.c: Fix out of bounds write bug spotted by valgrind. * src/database.c: Fix minor memory leak spotted by valgrind. Valgrind is at http://devel-home.kde.org/~sewardj/. diff -r 2b7ddb90d9b2 -r fbff73fe5b40 ChangeLog --- a/ChangeLog Thu Feb 14 17:17:02 2002 +0000 +++ b/ChangeLog Tue Feb 26 17:13:31 2002 +0000 @@ -1,3 +1,14 @@ +Tue Feb 26 2002 Jim Hague + +* src/client.c: That wasn't a memory leak fixed on Feb 8th. That was a + cockup cause by my forgetting that Cont_app takes ownership of an + overview. Revert it and add comment to Cont_app. Spotted with the aid + of valgrind. +* src/post.c,src/pseudo.c +* src/util.c: Fix out of bounds write bug spotted by valgrind. +* src/database.c: Fix minor memory leak spotted by valgrind. + Valgrind is at http://devel-home.kde.org/~sewardj/. + Thu Feb 14 2002 Jim Hague * src/over.c: Fix warning. diff -r 2b7ddb90d9b2 -r fbff73fe5b40 src/client.c --- a/src/client.c Thu Feb 14 17:17:02 2002 +0000 +++ b/src/client.c Tue Feb 26 17:13:31 2002 +0000 @@ -1,7 +1,7 @@ /* client.c - $Id: client.c 364 2002-02-08 17:06:25Z bears $ + $Id: client.c 371 2002-02-26 17:13:31Z bears $ */ #if HAVE_CONFIG_H @@ -1026,7 +1026,7 @@ del_Over( ov ); continue; } - Cont_app( ov ); + Cont_app( ov ); /* Cont modules owns ov after this */ prepareEntry( ov ); if ( action == FILTER_FULL || ( action == FILTER_THREAD && needsMark( ref ) ) ) @@ -1034,7 +1034,6 @@ Req_add( client.serv, msgId ); ++cntMarked; } - del_Over( ov ); } Grp_setRmtNext( client.grp, rmtNumb + 1 ); } diff -r 2b7ddb90d9b2 -r fbff73fe5b40 src/database.c --- a/src/database.c Thu Feb 14 17:17:02 2002 +0000 +++ b/src/database.c Tue Feb 26 17:13:31 2002 +0000 @@ -1,7 +1,7 @@ /* database.c - $Id: database.c 316 2001-10-31 11:44:53Z bears $ + $Id: database.c 371 2002-02-26 17:13:31Z bears $ Uses GNU gdbm library. Using Berkeley db (included in libc6) was cumbersome. It is based on Berkeley db 1.85, which has severe bugs @@ -606,6 +606,7 @@ Itl_next( refs ); /* Throw away group number */ } + del_Itl( refs ); return res; } diff -r 2b7ddb90d9b2 -r fbff73fe5b40 src/post.c --- a/src/post.c Thu Feb 14 17:17:02 2002 +0000 +++ b/src/post.c Tue Feb 26 17:13:31 2002 +0000 @@ -1,7 +1,7 @@ /* post.c - $Id: post.c 342 2001-12-09 12:31:57Z bears $ + $Id: post.c 371 2002-02-26 17:13:31Z bears $ */ #if HAVE_CONFIG_H @@ -75,7 +75,7 @@ msgId = article.over.msgId; Cont_read( grp ); - Cont_app( over ); + Cont_app( over ); /* Cont modules owns ov after this */ Log_dbg( LOG_DBG_POST, "Added message '%s' to group '%s'.", msgId, grp ); if ( !article.posted ) diff -r 2b7ddb90d9b2 -r fbff73fe5b40 src/pseudo.c --- a/src/pseudo.c Thu Feb 14 17:17:02 2002 +0000 +++ b/src/pseudo.c Tue Feb 26 17:13:31 2002 +0000 @@ -1,7 +1,7 @@ /* pseudo.c - $Id: pseudo.c 342 2001-12-09 12:31:57Z bears $ + $Id: pseudo.c 371 2002-02-26 17:13:31Z bears $ */ #if HAVE_CONFIG_H @@ -203,7 +203,7 @@ ov = genOv( rawSubj, DynStr_str( body ), "PSEUDO" ); if ( body && artTxt && ov ) { - Cont_app( ov ); + Cont_app( ov ); /* Cont modules owns ov after this */ if ( Db_prepareEntry( ov, Cont_grp(), Cont_last() ) ) Db_storeArt( Ov_msgId( ov ), DynStr_str( artTxt ) ); if ( Cont_write() ) diff -r 2b7ddb90d9b2 -r fbff73fe5b40 src/util.c --- a/src/util.c Thu Feb 14 17:17:02 2002 +0000 +++ b/src/util.c Tue Feb 26 17:13:31 2002 +0000 @@ -1,7 +1,7 @@ /* util.c - $Id: util.c 342 2001-12-09 12:31:57Z bears $ + $Id: util.c 371 2002-02-26 17:13:31Z bears $ */ #if HAVE_CONFIG_H @@ -185,7 +185,7 @@ while ( isspace( *line ) ) ++line; p = line + strlen( line ) - 1; - while ( isspace( *p ) ) + while ( p >= line && isspace( *p ) ) { *p = '\0'; --p;