reconnect: collect mallocs/frees of the previous reconnection
Signed-off-by: wanghonghao <wanghonghao@bytedance.com>
This commit is contained in:
@@ -463,6 +463,9 @@ int iscsi_reconnect(struct iscsi_context *iscsi)
|
|||||||
iscsi_free(iscsi, iscsi->smalloc_ptrs[i]);
|
iscsi_free(iscsi, iscsi->smalloc_ptrs[i]);
|
||||||
}
|
}
|
||||||
iscsi_free(iscsi, iscsi->opaque);
|
iscsi_free(iscsi, iscsi->opaque);
|
||||||
|
|
||||||
|
iscsi->old_iscsi->mallocs += iscsi->mallocs;
|
||||||
|
iscsi->old_iscsi->frees += iscsi->frees;
|
||||||
tmp_iscsi->old_iscsi = iscsi->old_iscsi;
|
tmp_iscsi->old_iscsi = iscsi->old_iscsi;
|
||||||
} else {
|
} else {
|
||||||
tmp_iscsi->old_iscsi = malloc(sizeof(struct iscsi_context));
|
tmp_iscsi->old_iscsi = malloc(sizeof(struct iscsi_context));
|
||||||
|
|||||||
Reference in New Issue
Block a user