Skip to content

Commit 4ed7946

Browse files
author
fdrake
committed
Fix memory leak. This is part of SF patch #478006.
git-svn-id: http://svn.python.org/projects/python/trunk@24198 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent c1975c4 commit 4ed7946

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/sunaudiodev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ newsadobject(PyObject *args)
103103
}
104104
if (fd < 0) {
105105
PyErr_SetFromErrnoWithFilename(SunAudioError, opendev);
106+
PyMem_DEL(ctldev);
106107
return NULL;
107108
}
108109
PyMem_DEL(ctldev);

Python/thread_pthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
200200
/* Restore signal mask for original thread */
201201
SET_THREAD_SIGMASK(SIG_SETMASK, &oldmask, NULL);
202202

203-
#ifdef THREAD_STACK_SIZE
203+
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
204204
pthread_attr_destroy(&attrs);
205205
#endif
206206
if (success == 0) {

0 commit comments

Comments
 (0)