io-stats : null dereference coverity fix.

CID      :1124502

Change-Id: I2911be340e8e48a52e951d0f04f6a96f3c219fab
BUG: 789278
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/9659
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Manikandan Selvaganesh 2015-02-16 14:26:54 +05:30 committed by Vijay Bellur
parent d680cbb47a
commit 49d68945c0

View File

@ -481,11 +481,13 @@ ios_stat_add_to_list (struct ios_stat_head *list_head, uint64_t value,
new->value = value;
ios_stat_ref (iosstat);
list_add_tail (&new->list, &tmp->list);
stat = last->iosstat;
last->iosstat = NULL;
ios_stat_unref (stat);
list_del (&last->list);
GF_FREE (last);
if (last) {
stat = last->iosstat;
last->iosstat = NULL;
ios_stat_unref (stat);
list_del (&last->list);
GF_FREE (last);
}
if (reposition == MAX_LIST_MEMBERS)
list_head->min_cnt = value;
else if (min_count) {