From 3344d1a728d37f0fb3e82a6a945eee0c780eb734 Mon Sep 17 00:00:00 2001
From: Chernov Dmitriy <cd_work@mail.ru>
Date: 周三, 02 3月 2016 21:29:32 +0800
Subject: [PATCH] Fix potential memory leak. #73

---
 libscpi/src/minimal.c |   23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/libscpi/src/minimal.c b/libscpi/src/minimal.c
index ecfcaf2..8abd39d 100644
--- a/libscpi/src/minimal.c
+++ b/libscpi/src/minimal.c
@@ -77,25 +77,10 @@
  * @return 
  */
 scpi_result_t SCPI_SystemErrorNextQ(scpi_t * context) {
-	scpi_error_t error;
-	if(!SCPI_ErrorPopEx(context, &error))return SCPI_RES_ERR;
-	
-    //int16_t err = SCPI_ErrorPop(context);
-
-    SCPI_ResultInt32(context, error.error_code);
-    SCPI_ResultText(context, SCPI_ErrorTranslate(error.error_code));
-	
-	size_t info_len=0;
-	if(error.device_dependent_info){
-		info_len=SCPIDEFINE_strnlen(error.device_dependent_info,255);
-		SCPI_ResultCharacters(context, ";", 1);
-		SCPI_ResultText(context, error.device_dependent_info);
-		SCPIDEFINE_free(error.device_dependent_info);		
-	}
-	
-
-	
-    return SCPI_RES_OK;
+	scpi_error_t error;	
+	SCPI_ErrorPop(context, &error);
+	SCPI_ResultError(context, &error);
+	return SCPI_RES_OK;
 }
 
 /**

--
Gitblit v1.9.1