From afe947555b59c38e521d588e3e4ba96a9b764ff4 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 31 Dec 1999 19:50:54 -0500 Subject: remember to free gpib output string --- gpib.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gpib.c') 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 */ -- cgit