diff options
author | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 20:03:23 -0500 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 20:03:23 -0500 |
commit | 8c63fc997dbfa0e6268537482df97d0fa744010a (patch) | |
tree | 02cbdb13a198fbab873e4a54d9b6fd16337784a6 | |
parent | 401025aebc02eca587474e094fa50b2939f8a147 (diff) |
set output string pointer to NULL after freeing it
-rw-r--r-- | globals.c | 1 | ||||
-rw-r--r-- | gpib.c | 9 |
2 files changed, 7 insertions, 3 deletions
@@ -14,6 +14,7 @@ GlobalStruct globals = { .Registers.last_relay_driver_settings[2] = -1, .Registers.gpib_input_buffer[0] = 0, + .Registers.pending_output_message = NULL, .VxiLocks.locked_network_server = NO_SERVER_LOCKED }; @@ -635,8 +635,9 @@ int GPIB_check_for_device_clear_signal(void) TNT_4882_Status(STB,0x10,CLEAR); // Clear MAV bit g_free (globals.Registers.pending_output_message); + globals.Registers.pending_output_message = NULL; - TNT_Holdoff_off(); + TNT_Holdoff_off(); TNT_INT_STATUS(); return TRUE; @@ -788,6 +789,7 @@ void GPIB_start_query_response(gpointer *ignore_this, char *in_string) if (globals.Registers.pending_output_message != NULL) { queue_error_for_gpib_only(query_error_interrupted); g_free (globals.Registers.pending_output_message); + globals.Registers.pending_output_message = NULL; } globals.Registers.pending_output_message = g_strdup_printf ("%s\n", in_string); @@ -798,8 +800,8 @@ void GPIB_start_query_response(gpointer *ignore_this, char *in_string) void GPIB_finish_query_response() { if (!globals.HWDetect.gpib) { - return; - } + return; + } if (globals.Registers.pending_output_message == NULL) { return; @@ -888,6 +890,7 @@ void GPIB_finish_query_response() INTERFACE_STATUS|=UCMPL; // Set the user complete bit g_free (globals.Registers.pending_output_message); + globals.Registers.pending_output_message = NULL; if (GPIB_check_for_device_clear_signal()) { return; |