diff --git a/vpi/sys_lxt.c b/vpi/sys_lxt.c index 1fadd3945..29b4d0cf0 100644 --- a/vpi/sys_lxt.c +++ b/vpi/sys_lxt.c @@ -730,13 +730,13 @@ static PLI_INT32 sys_dumpvars_calltf(PLI_BYTE8*name) if (dump_file == 0) { open_dumpfile(callh); if (dump_file == 0) { - vpi_free_object(argv); + if (argv) vpi_free_object(argv); return 0; } } if (install_dumpvars_callback()) { - vpi_free_object(argv); + if (argv) vpi_free_object(argv); return 0; } diff --git a/vpi/sys_lxt2.c b/vpi/sys_lxt2.c index e8c36e219..2b89d96c4 100644 --- a/vpi/sys_lxt2.c +++ b/vpi/sys_lxt2.c @@ -785,13 +785,13 @@ static PLI_INT32 sys_dumpvars_calltf(PLI_BYTE8*name) if (dump_file == 0) { open_dumpfile(callh); if (dump_file == 0) { - vpi_free_object(argv); + if (argv) vpi_free_object(argv); return 0; } } if (install_dumpvars_callback()) { - vpi_free_object(argv); + if (argv) vpi_free_object(argv); return 0; } diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index 027c89817..9e044e462 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -755,13 +755,13 @@ static PLI_INT32 sys_dumpvars_calltf(PLI_BYTE8*name) if (dump_file == 0) { open_dumpfile(callh); if (dump_file == 0) { - vpi_free_object(argv); + if (argv) vpi_free_object(argv); return 0; } } if (install_dumpvars_callback()) { - vpi_free_object(argv); + if (argv) vpi_free_object(argv); return 0; }