Fix memory leak. This is part of SF patch #478006.

This commit is contained in:
Fred Drake 2001-11-09 16:00:41 +00:00
parent f12a68ccd0
commit 03459a5cd7
2 changed files with 2 additions and 1 deletions

View File

@ -103,6 +103,7 @@ newsadobject(PyObject *args)
}
if (fd < 0) {
PyErr_SetFromErrnoWithFilename(SunAudioError, opendev);
PyMem_DEL(ctldev);
return NULL;
}
PyMem_DEL(ctldev);

View File

@ -200,7 +200,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
/* Restore signal mask for original thread */
SET_THREAD_SIGMASK(SIG_SETMASK, &oldmask, NULL);
#ifdef THREAD_STACK_SIZE
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_destroy(&attrs);
#endif
if (success == 0) {