diff options
author | davidxu <davidxu@FreeBSD.org> | 2004-08-16 05:20:12 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2004-08-16 05:20:12 +0000 |
commit | cea7c80bb2393142bba9922eeac2984b16aab8fa (patch) | |
tree | 33281c8c932d99bd459bea860c26c3d11e91900a /lib/libthread_db | |
parent | ceceffc9d5bed124987d16094d4e9198f096dbfd (diff) | |
download | FreeBSD-src-cea7c80bb2393142bba9922eeac2984b16aab8fa.zip FreeBSD-src-cea7c80bb2393142bba9922eeac2984b16aab8fa.tar.gz |
Plug a memory leak in error case.
Diffstat (limited to 'lib/libthread_db')
-rw-r--r-- | lib/libthread_db/libpthread_db.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libthread_db/libpthread_db.c b/lib/libthread_db/libpthread_db.c index c40b66a..603f30e 100644 --- a/lib/libthread_db/libpthread_db.c +++ b/lib/libthread_db/libpthread_db.c @@ -400,8 +400,10 @@ pt_ta_tsd_iter(const td_thragent_t *ta, td_key_iter_f *ki, void *arg) return (TD_MALLOC); ret = ps_pread(ta->ph, (psaddr_t)ta->thread_keytable_addr, keytable, ta->thread_max_keys * ta->thread_size_key); - if (ret != 0) + if (ret != 0) { + free(keytable); return (P2T(ret)); + } for (i = 0; i < ta->thread_max_keys; i++) { allocated = *(int *)(keytable + i * ta->thread_size_key + ta->thread_off_key_allocated); |