Menu

#11 Return from svc_install() without cleaning up?

none
closed-wont-fix
nobody
None
low
2014-03-12
2011-07-12
Thomas Hood
No

The line

return NT_STATUS_UNSUCCESSFUL;

in svc_install() in service.c returns from the middle of the function when it appears that it ought to clean up first, with talloc_free() and/or whatnot. Please correct me if I'm wrong --- I don't fully understand the code (yet) but this looks enough like a bug that I thought I'd bring it to the author's attention.

[...]
{
struct SERVICE_STATUS s;
do {
msleep(100);
status = svc_QueryServiceStatus(svc_pipe, &svc_handle, &s);
NT_ERR(status, 1, "QueryServiceStatus failed");
} while (s.state == SVCCTL_START_PENDING);
if (s.state != SVCCTL_RUNNING) {
DEBUG(0, ("Service cannot start, status=0x%08X\n", s.state));
return NT_STATUS_UNSUCCESSFUL;
}
}
svc_CloseServiceHandle(svc_pipe, &svc_handle);
svc_CloseServiceHandle(svc_pipe, &scm_handle);
talloc_free(svc_pipe);
return status;
}

Discussion

  • Thomas Hood

    Thomas Hood - 2011-07-12
    • summary: Return from svn_install() without cleaning up? --> Return from svc_install() without cleaning up?
     
  • Thomas Hood

    Thomas Hood - 2013-04-17

    This can be closed: the caller always exits soon after NT_STATUS_UNSUCCESSFUL.

     
  • Thomas Hood

    Thomas Hood - 2014-03-12
    • status: wont-fix --> closed-wont-fix
    • Priority: 2 --> low
     

Log in to post a comment.

MongoDB Logo MongoDB