From: Timo Sirainen Date: Fri, 15 Oct 2010 23:34:28 +0000 (+0100) Subject: lib-storage: mail_user_get_home(): Make sure user_r is always set. X-Git-Tag: 2.0.6~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72276c90ac2a38c9db7b4458acd3a2f5b61892bb;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mail_user_get_home(): Make sure user_r is always set. --- diff --git a/src/lib-storage/mail-user.c b/src/lib-storage/mail-user.c index 1f71cd0e83..30071cfeef 100644 --- a/src/lib-storage/mail-user.c +++ b/src/lib-storage/mail-user.c @@ -270,6 +270,7 @@ int mail_user_get_home(struct mail_user *user, const char **home_r) *home_r = user->_home; return user->_home != NULL ? 1 : 0; } + *home_r = NULL; if (mail_user_auth_master_conn == NULL) return 0; @@ -278,9 +279,7 @@ int mail_user_get_home(struct mail_user *user, const char **home_r) ret = auth_master_user_lookup(mail_user_auth_master_conn, user->username, &info, userdb_pool, &username, &fields); - if (ret < 0) - *home_r = NULL; - else { + if (ret >= 0) { auth_user_fields_parse(fields, userdb_pool, &reply); user->_home = ret == 0 ? NULL : p_strdup(user->pool, reply.home);