(mailbox_create): Bugfix. Return failure if the folder cannot be created.
Showing
1 changed file
with
4 additions
and
12 deletions
... | @@ -109,24 +109,16 @@ mailbox_create (mailbox_t *pmbox, const char *name) | ... | @@ -109,24 +109,16 @@ mailbox_create (mailbox_t *pmbox, const char *name) |
109 | 109 | ||
110 | /* Create the folder before initializing the concrete mailbox. | 110 | /* Create the folder before initializing the concrete mailbox. |
111 | The mailbox needs it's back pointer. */ | 111 | The mailbox needs it's back pointer. */ |
112 | { | 112 | status = folder_create (&mbox->folder, name); |
113 | folder_t folder; | 113 | |
114 | if (folder_create (&folder, name) == 0) | 114 | if (status == 0) |
115 | mbox->folder = folder; | 115 | status = m_init (mbox); /* Create the concrete mailbox type. */ |
116 | } | ||
117 | 116 | ||
118 | /* Create the concrete mailbox type. */ | ||
119 | status = m_init (mbox); | ||
120 | if (status != 0) | 117 | if (status != 0) |
121 | { | ||
122 | mailbox_destroy (&mbox); | 118 | mailbox_destroy (&mbox); |
123 | } | ||
124 | else | 119 | else |
125 | { | ||
126 | *pmbox = mbox; | 120 | *pmbox = mbox; |
127 | } | 121 | } |
128 | |||
129 | } | ||
130 | else | 122 | else |
131 | status = MU_ERR_NO_HANDLER; | 123 | status = MU_ERR_NO_HANDLER; |
132 | 124 | ... | ... |
-
Please register or sign in to post a comment