aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-01 04:14:00 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-01 04:14:00 +0800
commit4b63089bda38776bf4aa20dc97e6db41823a061c (patch)
tree1fde7a92531e4fb0bb09f2c2268966c39dfb20f2 /camel
parent60a6173744071e0eeacd73cfcba029fa593e81ac (diff)
downloadgsoc2013-evolution-4b63089bda38776bf4aa20dc97e6db41823a061c.tar.gz
gsoc2013-evolution-4b63089bda38776bf4aa20dc97e6db41823a061c.tar.zst
gsoc2013-evolution-4b63089bda38776bf4aa20dc97e6db41823a061c.zip
Revert my fix from the other day since camel_imap_command_response()
2002-05-31 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (imap_rescan): Revert my fix from the other day since camel_imap_command_response() doesn't guarentee that resp will be set to NULL on error. * providers/imap/camel-imap-command.c (camel_imap_command_response): Use a different variable to get the return of imap_parse_untagged so that we don't lose the pointer to the original malloc'd respbuf buffer. svn path=/trunk/; revision=17061
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/providers/imap/camel-imap-command.c9
-rw-r--r--camel/providers/imap/camel-imap-folder.c6
3 files changed, 18 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 2005945eb9..aa2a0b9826 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,14 @@
2002-05-31 Jeffrey Stedfast <fejj@ximian.com>
+ * providers/imap/camel-imap-folder.c (imap_rescan): Revert my fix
+ from the other day since camel_imap_command_response() doesn't
+ guarentee that resp will be set to NULL on error.
+
+ * providers/imap/camel-imap-command.c
+ (camel_imap_command_response): Use a different variable to get the
+ return of imap_parse_untagged so that we don't lose the pointer to
+ the original malloc'd respbuf buffer.
+
* camel-data-cache.c (camel_data_cache_get): If we fail to be able
to create a stream to insert into the cache, then free the 'real'
path.
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 4309e18ddd..82ddf26ce7 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;
+ char *respbuf, *untagged;
if (camel_imap_store_readline (store, &respbuf, ex) < 0) {
CAMEL_IMAP_STORE_UNLOCK (store, command_lock);
@@ -312,9 +312,12 @@ camel_imap_command_response (CamelImapStore *store, char **response,
/* Read the rest of the response. */
type = CAMEL_IMAP_RESPONSE_UNTAGGED;
- respbuf = imap_read_untagged (store, respbuf, ex);
- if (!respbuf)
+ untagged = imap_read_untagged (store, respbuf, ex);
+ if (!untagged) {
type = CAMEL_IMAP_RESPONSE_ERROR;
+ g_free (respbuf);
+ respbuf = NULL;
+ }
break;
case '+':
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index e798dcbebf..156111083a 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -513,9 +513,6 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
g_datalist_clear (&data);
}
- /* Free the final tagged response */
- g_free (resp);
-
camel_operation_end (NULL);
if (type == CAMEL_IMAP_RESPONSE_ERROR) {
for (i = 0; i < summary_len && new[i].uid; i++)
@@ -524,6 +521,9 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
return;
}
+ /* Free the final tagged response */
+ g_free (resp);
+
/* If we find a UID in the summary that doesn't correspond to
* the UID in the folder, then either: (a) it's a real UID,
* but the message was deleted on the server, or (b) it's a