summaryrefslogtreecommitdiff
path: root/src/daemon/dlt-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/dlt-daemon.c')
-rwxr-xr-xsrc/daemon/dlt-daemon.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index 79d8bea..04612bb 100755
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -1527,11 +1527,15 @@ int dlt_daemon_process_user_message_register_context(DltDaemon *daemon, DltDaemo
}
msg.datasize = sizeof(DltServiceGetLogInfoRequest);
- if (msg.databuffer)
+ if (msg.databuffer && (msg.databuffersize < msg.datasize))
{
free(msg.databuffer);
+ msg.databuffer=0;
+ }
+ if (msg.databuffer == 0){
+ msg.databuffer = (uint8_t *) malloc(msg.datasize);
+ msg.databuffersize = msg.datasize;
}
- msg.databuffer = (uint8_t *) malloc(msg.datasize);
if (msg.databuffer==0)
{
dlt_log(LOG_ERR,"Can't allocate buffer for get log info message\n");