From b3f58d5f75da9c28129972ce2343f423afadb5ff Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Thu, 8 Dec 2005 12:02:48 +0000 Subject: Plug potential memory and socket leak when polling multiple folders or when the upstream sends bogus message sizes. Patch by Sunil Shetye. svn path=/branches/BRANCH_6-3/; revision=4527 --- driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 71bd72f4..4dffcb41 100644 --- a/driver.c +++ b/driver.c @@ -1373,7 +1373,8 @@ is restored.")); if (count > INT_MAX/sizeof(int)) { report(stderr, GT_("bogus message count!")); - return(PS_PROTOCOL); + err = PS_PROTOCOL; + goto cleanUp; } /* @@ -1389,6 +1390,7 @@ is restored.")); if (proto->getsizes && !(proto->getpartialsizes && NUM_NONZERO(ctl->fetchsizelimit))) { + xfree(msgsizes); msgsizes = xmalloc(sizeof(int) * count); for (i = 0; i < count; i++) msgsizes[i] = 0; -- cgit v1.2.3