diff --git a/src/datasource/systemd-unit-name.c b/src/datasource/systemd-unit-name.c index 51eea230..de6c9302 100644 --- a/src/datasource/systemd-unit-name.c +++ b/src/datasource/systemd-unit-name.c @@ -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);