From cb87694407faa04a165e7f6987f8a457c34e4cf2 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 25 Jul 2010 14:52:27 +0000 Subject: [PATCH] 2010-07-25 Joel Sherrill * libcsupport/src/gxx_wrappers.c: Free contents of key not key itself. Kye pointer will never be malloc'ed. --- cpukit/ChangeLog | 5 +++++ cpukit/libcsupport/src/gxx_wrappers.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 1357649e2c..3cb39246ea 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2010-07-25 Joel Sherrill + + * libcsupport/src/gxx_wrappers.c: Free contents of key not key itself. + Kye pointer will never be malloc'ed. + 2010-07-24 Joel Sherrill * libcsupport/Makefile.am, libcsupport/src/termios_baud2num.c, diff --git a/cpukit/libcsupport/src/gxx_wrappers.c b/cpukit/libcsupport/src/gxx_wrappers.c index 242b739b03..924b506831 100644 --- a/cpukit/libcsupport/src/gxx_wrappers.c +++ b/cpukit/libcsupport/src/gxx_wrappers.c @@ -122,9 +122,10 @@ int rtems_gxx_key_delete (__gthread_key_t key) status = rtems_task_variable_delete( RTEMS_SELF, (void **)key ); if ( status == RTEMS_SUCCESSFUL ) { /* Hmm - hopefully all tasks using this key have gone away... */ - if ( key ) free( (void *)key ); + if ( key ) free( *(void **)key ); return 0; } + key = NULL; return 0; }