aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-01 04:43:05 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-01 04:43:05 +0800
commitb2cae6f3176e10b891a35ce8146ab4f88feec8b1 (patch)
treef8f66893e130dbe0d9579a4443049dea63888772 /camel/providers
parentc0836df7ef28cff8195ba4592b9a02e82436df3b (diff)
downloadgsoc2013-evolution-b2cae6f3176e10b891a35ce8146ab4f88feec8b1.tar.gz
gsoc2013-evolution-b2cae6f3176e10b891a35ce8146ab4f88feec8b1.tar.zst
gsoc2013-evolution-b2cae6f3176e10b891a35ce8146ab4f88feec8b1.zip
If we fail to read a literal, free the temporary string buffer.
2002-05-31 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-command.c (imap_read_untagged): If we fail to read a literal, free the temporary string buffer. svn path=/trunk/; revision=17063
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-command.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 82ddf26ce7..49e23a944f 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -288,7 +288,7 @@ camel_imap_command_response (CamelImapStore *store, char **response,
CamelException *ex)
{
CamelImapResponseType type;
- char *respbuf, *untagged;
+ char *respbuf;
if (camel_imap_store_readline (store, &respbuf, ex) < 0) {
CAMEL_IMAP_STORE_UNLOCK (store, command_lock);
@@ -312,12 +312,9 @@ camel_imap_command_response (CamelImapStore *store, char **response,
/* Read the rest of the response. */
type = CAMEL_IMAP_RESPONSE_UNTAGGED;
- untagged = imap_read_untagged (store, respbuf, ex);
- if (!untagged) {
+ respbuf = imap_read_untagged (store, respbuf, ex);
+ if (!respbuf)
type = CAMEL_IMAP_RESPONSE_ERROR;
- g_free (respbuf);
- respbuf = NULL;
- }
break;
case '+':
@@ -442,12 +439,14 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
else
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, g_strerror (errno));
camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
+ g_string_free (str, TRUE);
goto lose;
}
if (nread < length) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("Server response ended too soon."));
camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
+ g_string_free (str, TRUE);
goto lose;
}
str->str[length + 1] = '\0';