summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gpib.c b/gpib.c
index 2277b7a..2d9d608 100644
--- a/gpib.c
+++ b/gpib.c
@@ -784,7 +784,11 @@ int GPIB_send_query_response(gpointer *ignore_this, char *in_string)
queue_error_for_gpib_only(query_error_interrupted);
}
- gchar *out_buffer = g_strdup_printf ("%s\n", in_string);
+ // needs to be freed
+ gchar *term_string = g_strdup_printf ("%s\n", in_string);
+
+ // just a pointer
+ char *out_buffer = term_string;
/* message must be available if this function has been called */
@@ -875,6 +879,8 @@ int GPIB_send_query_response(gpointer *ignore_this, char *in_string)
INTERFACE_STATUS|=UCMPL; /* Set the user complete bit */
+ g_free (term_string);
+
if (INTERFACE_STATUS&DCAS) {
TNT_4882_Status(STB,0x10,CLEAR); /* Clear MAV bit */