/* Write up to the newline. */\r
ret = try_write(logger, address, i, &out, &complained);\r
if (ret < 0) {\r
- HeapFree(GetProcessHeap(), 0, logger);\r
CloseHandle(logger->read_handle);\r
CloseHandle(logger->write_handle);\r
+ HeapFree(GetProcessHeap(), 0, logger);\r
return 3;\r
}\r
size += (__int64) out;\r
error = GetLastError();\r
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_CREATEFILE_FAILED, logger->path, error_string(error), 0);\r
/* Oh dear. Now we can't log anything further. */\r
- HeapFree(GetProcessHeap(), 0, logger);\r
CloseHandle(logger->read_handle);\r
CloseHandle(logger->write_handle);\r
+ HeapFree(GetProcessHeap(), 0, logger);\r
return 4;\r
}\r
\r
ret = try_write(logger, address, in, &out, &complained);\r
size += (__int64) out;\r
if (ret < 0) {\r
- HeapFree(GetProcessHeap(), 0, logger);\r
CloseHandle(logger->read_handle);\r
CloseHandle(logger->write_handle);\r
+ HeapFree(GetProcessHeap(), 0, logger);\r
return 3;\r
}\r
}\r
\r
- HeapFree(GetProcessHeap(), 0, logger);\r
CloseHandle(logger->read_handle);\r
CloseHandle(logger->write_handle);\r
+ HeapFree(GetProcessHeap(), 0, logger);\r
return 0;\r
}\r