Skip to content

Commit

Permalink
Close config file handle on error. (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-aurora authored May 9, 2024
1 parent c3dcd60 commit 35f599d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/daemon/dlt-daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,20 +573,26 @@ int option_file_parser(DltDaemonLocal *daemon_local)
else if (strcmp(token, "RingbufferMinSize") == 0)
{
if (dlt_daemon_check_numeric_setting(token,
value, &(daemon_local->RingbufferMinSize)) < 0)
value, &(daemon_local->RingbufferMinSize)) < 0) {
fclose (pFile);
return -1;
}
}
else if (strcmp(token, "RingbufferMaxSize") == 0)
{
if (dlt_daemon_check_numeric_setting(token,
value, &(daemon_local->RingbufferMaxSize)) < 0)
value, &(daemon_local->RingbufferMaxSize)) < 0) {
fclose (pFile);
return -1;
}
}
else if (strcmp(token, "RingbufferStepSize") == 0)
{
if (dlt_daemon_check_numeric_setting(token,
value, &(daemon_local->RingbufferStepSize)) < 0)
value, &(daemon_local->RingbufferStepSize)) < 0) {
fclose (pFile);
return -1;
}
}
else if (strcmp(token, "SharedMemorySize") == 0)
{
Expand Down Expand Up @@ -755,8 +761,10 @@ int option_file_parser(DltDaemonLocal *daemon_local)
else if (strcmp(token, "DaemonFIFOSize") == 0)
{
if (dlt_daemon_check_numeric_setting(token,
value, &(daemon_local->daemonFifoSize)) < 0)
value, &(daemon_local->daemonFifoSize)) < 0) {
fclose (pFile);
return -1;
}
#ifndef __linux__
printf("Option DaemonFIFOSize is set but only supported on Linux. Ignored.\n");
#endif
Expand Down

0 comments on commit 35f599d

Please sign in to comment.