Skip to content

Commit

Permalink
replication: Check ruser for NULL
Browse files Browse the repository at this point in the history
Satisfies static analyzers
  • Loading branch information
cmouse authored and mrannanj committed Feb 20, 2018
1 parent 6b49867 commit fa4ab39
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/replication/replication-plugin.c
Expand Up @@ -106,6 +106,7 @@ static void replication_notify_now(struct mail_user *user)
struct replication_user *ruser = REPLICATION_USER_CONTEXT(user);
int ret;

i_assert(ruser != NULL);
i_assert(ruser->priority != REPLICATION_PRIORITY_NONE);
i_assert(ruser->priority != REPLICATION_PRIORITY_SYNC);

Expand All @@ -129,6 +130,8 @@ static int replication_notify_sync(struct mail_user *user)
ssize_t ret;
bool success = FALSE;

i_assert(ruser != NULL);

fd = net_connect_unix(ruser->socket_path);
if (fd == -1) {
i_error("net_connect_unix(%s) failed: %m", ruser->socket_path);
Expand Down Expand Up @@ -302,6 +305,8 @@ static void replication_user_deinit(struct mail_user *user)
{
struct replication_user *ruser = REPLICATION_USER_CONTEXT(user);

i_assert(ruser != NULL);

if (ruser->to != NULL) {
replication_notify_now(user);
if (ruser->to != NULL) {
Expand Down

0 comments on commit fa4ab39

Please sign in to comment.