|
@@ -1040,8 +1040,9 @@ parse_list_rsp( imap_store_t *ctx, list_t *list, char *cmd )
|
|
|
list_t *lp;
|
|
|
|
|
|
if (!is_list( list )) {
|
|
|
- error( "IMAP error: malformed LIST response\n" );
|
|
|
free_list( list );
|
|
|
+ bad_list:
|
|
|
+ error( "IMAP error: malformed LIST response\n" );
|
|
|
return LIST_BAD;
|
|
|
}
|
|
|
for (lp = list->child; lp; lp = lp->next)
|
|
@@ -1050,7 +1051,8 @@ parse_list_rsp( imap_store_t *ctx, list_t *list, char *cmd )
|
|
|
return LIST_OK;
|
|
|
}
|
|
|
free_list( list );
|
|
|
- arg = next_arg( &cmd );
|
|
|
+ if (!(arg = next_arg( &cmd )))
|
|
|
+ goto bad_list;
|
|
|
if (!ctx->delimiter)
|
|
|
ctx->delimiter = nfstrdup( arg );
|
|
|
return parse_list( ctx, cmd, parse_list_rsp_p2 );
|