Fix memory leak introduced yesterday in imapx QRESYNC
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 12 Nov 2010 11:15:11 +0000 (11:15 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 12 Nov 2010 11:15:11 +0000 (11:15 +0000)
commit88f485160ad74a3061ebd9be19d311ec2889877f
tree41fc860f29b169a3dbe48fe6c1610088fcd3e668
parent704ca40a2c44a85c808377af15cc7beb5346b336
Fix memory leak introduced yesterday in imapx QRESYNC

Commit 0c866faf ("Fix QRESYNC protocol violation (RH #648082))
introduced a potential leak of the 'lastuid' and 'firstuid' strings.

It would almost never happen, because it would require that we're
selecting a folder on a QRESYNC-capable server where we *have*
previously seen messages in that folder, but for some reason we don't
have a record of the uidvalidity and previous modification sequence
(modseq). The only time that's ever likely to happen is perhaps the
first time we connect to the server after QRESYNC is enabled. But that's
no excuse.

Fix this by simplifying the logic. There's no point in using QRESYNC if
our local cache knows of no messages in the folder *anyway*, so remove
that separate check and merge the 'if (total)' part into the existing
condition for actually issuing QRESYNC.

Spotted by Bojan Smojver.
camel/providers/imapx/camel-imapx-server.c