dovecot-2.2: lib-storage: Allow mail_storage_copy_error() with t...
    dovecot at dovecot.org 
    dovecot at dovecot.org
       
    Mon Jan 28 14:38:13 EET 2013
    
    
  
details:   http://hg.dovecot.org/dovecot-2.2/rev/6724d4ae26ec
changeset: 15677:6724d4ae26ec
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jan 28 14:37:59 2013 +0200
description:
lib-storage: Allow mail_storage_copy_error() with the same source and dest.
If it was used without checking it would try to free the error string and
after that strdup() it.
diffstat:
 src/lib-storage/mail-storage.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diffs (13 lines):
diff -r d3cda5a567be -r 6724d4ae26ec src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Mon Jan 28 13:56:24 2013 +0200
+++ b/src/lib-storage/mail-storage.c	Mon Jan 28 14:37:59 2013 +0200
@@ -492,6 +492,9 @@
 	const char *str;
 	enum mail_error error;
 
+	if (src == dest)
+		return;
+
 	str = mail_storage_get_last_error(src, &error);
 	mail_storage_set_error(dest, error, str);
 }
    
    
More information about the dovecot-cvs
mailing list