Skip to content

Commit

Permalink
ds: Fix bug with an incorrectly placed free() call
Browse files Browse the repository at this point in the history
  • Loading branch information
bostjan committed Jul 26, 2023
1 parent f3e2f7e commit dad36be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/datasource/systemd-unit-name.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ int snoopy_datasource_systemd_unit_name (char * const resultBuf, size_t resultBu
// Convert
unitName = snoopy_util_systemd_convertCgroupEntryToUnitName(cgroupEntry);
if (!unitName) {
retMsgLen = snprintf(resultBuf, resultBufSize, "%s", cgroupEntry+strlen("1:name=systemd:/"));
free(cgroupEntry);
return snprintf(resultBuf, resultBufSize, "%s", cgroupEntry+strlen("1:name=systemd:/"));
return retMsgLen;
}
free(cgroupEntry);

Expand Down

0 comments on commit dad36be

Please sign in to comment.