From 0659c743028c856c01cf9aa019bb26a3fd5657bd Mon Sep 17 00:00:00 2001 From: wanghonghao Date: Mon, 6 Apr 2020 21:08:34 +0800 Subject: [PATCH] reconnect: collect mallocs/frees of the previous reconnection Signed-off-by: wanghonghao --- lib/connect.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/connect.c b/lib/connect.c index 33c4fa2..daa7007 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -463,6 +463,9 @@ int iscsi_reconnect(struct iscsi_context *iscsi) iscsi_free(iscsi, iscsi->smalloc_ptrs[i]); } iscsi_free(iscsi, iscsi->opaque); + + iscsi->old_iscsi->mallocs += iscsi->mallocs; + iscsi->old_iscsi->frees += iscsi->frees; tmp_iscsi->old_iscsi = iscsi->old_iscsi; } else { tmp_iscsi->old_iscsi = malloc(sizeof(struct iscsi_context));