]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
convert plugin: Don't crash after finishing conversion.
authorTimo Sirainen <tss@iki.fi>
Tue, 26 May 2009 04:39:25 +0000 (00:39 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 26 May 2009 04:39:25 +0000 (00:39 -0400)
--HG--
branch : HEAD

src/plugins/convert/convert-storage.c

index 3a76a8c8483561e3831ce53e1d75a01180959b9e..efe06faac38d406552cb6ffdf781fad8160d5f12 100644 (file)
@@ -406,9 +406,11 @@ int convert_storage(const char *source_data,
        memset(&ns_set, 0, sizeof(ns_set));
        ns_set.location = source_data;
 
+       i_assert(user->namespaces == dest_namespaces);
        source_ns = mail_namespaces_init_empty(user);
-       source_ns->set = &ns_set;
+       user->namespaces = dest_namespaces;
 
+       source_ns->set = &ns_set;
        if (mail_storage_create(source_ns, NULL,
                                MAIL_STORAGE_FLAG_NO_AUTOCREATE, &error) < 0) {
                /* No need for conversion. */