data-request-example: free memory before exiting after a target register failure
Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
This commit is contained in:
parent
03f2e3dd7f
commit
ddc4623f0b
|
|
@ -195,12 +195,14 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else if (resp.code != 0) {
|
} else if (resp.code != 0) {
|
||||||
if (resp.hint)
|
if (resp.hint) {
|
||||||
log_error("%s: Cannot register target '%s': CCCSD error, %s (%d)",
|
log_error("%s: Cannot register target '%s': CCCSD error, %s (%d)",
|
||||||
__func__, TARGET_GET_TIME, resp.hint, resp.code);
|
__func__, TARGET_GET_TIME, resp.hint, resp.code);
|
||||||
else
|
free(resp.hint);
|
||||||
|
} else {
|
||||||
log_error("%s: Cannot register target '%s': CCCSD error, %d",
|
log_error("%s: Cannot register target '%s': CCCSD error, %d",
|
||||||
__func__, TARGET_GET_TIME, resp.code);
|
__func__, TARGET_GET_TIME, resp.code);
|
||||||
|
}
|
||||||
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue