Skip to content

Commit

Permalink
Move free from SCPI_ResultError to SCPI_SystemErrorNextQ to correspon…
Browse files Browse the repository at this point in the history
…d with SCPI_ErrorPop
  • Loading branch information
j123b567 committed Apr 24, 2016
1 parent 7d6b42c commit fdce1ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions libscpi/src/minimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "scpi/constants.h"
#include "scpi/error.h"
#include "scpi/ieee488.h"
#include "utils_private.h"

/**
* Command stub function
Expand Down Expand Up @@ -80,6 +81,9 @@ scpi_result_t SCPI_SystemErrorNextQ(scpi_t * context) {
scpi_error_t error;
SCPI_ErrorPop(context, &error);
SCPI_ResultError(context, &error);
#if USE_DEVICE_DEPENDENT_ERROR_INFORMATION
SCPIDEFINE_free(&context->error_info_heap, error.device_dependent_info, false);
#endif
return SCPI_RES_OK;
}

Expand Down
4 changes: 0 additions & 4 deletions libscpi/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,6 @@ size_t SCPI_ResultError(scpi_t * context, scpi_error_t * error) {
}
result += writeData(context, "\"", 1);

#if USE_DEVICE_DEPENDENT_ERROR_INFORMATION
SCPIDEFINE_free(&context->error_info_heap, error->device_dependent_info, false);
#endif

return result;
}

Expand Down

0 comments on commit fdce1ea

Please sign in to comment.