From 17051403bfb9916896afbfd2c4d0234d6d5b144b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 22 Mar 2020 11:25:32 +0100 Subject: osmo-sim-test: Avoid double-close Change-Id: Ibd67a5461085a77dd9e804a4f1266d67ee91a04a Closes: CID#208960 --- utils/osmo-sim-test.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'utils') diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c index 6cf36a6a..cf423c49 100644 --- a/utils/osmo-sim-test.c +++ b/utils/osmo-sim-test.c @@ -421,11 +421,8 @@ static int dump_file(struct osim_chan_hdl *chan, const char *short_name, uint16_ break; case EF_TYPE_TRANSP: if (g_class != 0xA0) { - if (!TLVP_PRESENT(&tp, UICC_FCP_T_FILE_SIZE)) { - if (f_data) - fclose(f_data); + if (!TLVP_PRESENT(&tp, UICC_FCP_T_FILE_SIZE)) goto out; - } i = ntohs(*(uint16_t *)TLVP_VAL(&tp, UICC_FCP_T_FILE_SIZE)); printf("File size: %d bytes\n", i); } else { -- cgit v1.2.3