glusterd-sm: NULL pointer dereferencing clang fix

Problem: new_event could be NULL.

Solution: Added a goto statement to address this issue.

Updates: bz#1193929
Change-Id: Id3ce28fc53ad2cc8b9fcb63f7774568d31073b9e
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
This commit is contained in:
Shwetha K Acharya 2018-09-07 11:20:49 +05:30 committed by Atin Mukherjee
parent 82640b7109
commit df697c68f6

View File

@ -993,6 +993,7 @@ glusterd_ac_handle_friend_add_req (glusterd_friend_sm_event_t *event, void *ctx)
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
GD_MSG_NO_MEMORY, "Out of Memory");
goto out;
}
new_event->peername = gf_strdup (event->peername);