git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbe0cc9
)
Kernel - Fixed freeing NULL
author
John Hodge
<
[email protected]
>
Sun, 29 Jan 2012 14:54:12 +0000
(22:54 +0800)
committer
John Hodge
<
[email protected]
>
Sun, 29 Jan 2012 14:54:12 +0000
(22:54 +0800)
Kernel/threads.c
patch
|
blob
|
history
diff --git
a/Kernel/threads.c
b/Kernel/threads.c
index
4bcbffd
..
87d30d3
100644
(file)
--- a/
Kernel/threads.c
+++ b/
Kernel/threads.c
@@
-150,10
+150,13
@@
void Threads_Delete(tThread *Thread)
Thread->Process->nThreads --;
if( Thread->Process->nThreads == 0 )
{
- Proc_ClearProcess( Thread->Process );
- free( Thread->Process->CurrentWorkingDir );
- free( Thread->Process->RootDir );
- free( Thread->Process );
+ tProcess *proc = Thread->Process;
+ Proc_ClearProcess( proc );
+ if( proc->CurrentWorkingDir)
+ free( proc->CurrentWorkingDir );
+ if( proc->RootDir )
+ free( proc->RootDir );
+ free( proc );
}
// Free name
UCC
git Repository :: git.ucc.asn.au