From c651ffc6c5cac0fa56a4af1f6cdfc60c847e8131 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Sat, 20 Oct 2007 12:35:12 +0200 Subject: [PATCH] Invalidate handle cache on handle removal I don't expect the lack of this was a real problem, but it should still be there to make sure the cache doesn't cause issues. Also remove the memset call that slipped in and isn't supposed to be there. --- apps/buffering.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/buffering.c b/apps/buffering.c index 3ffb96f43..cd09366a6 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -275,7 +275,10 @@ static bool rm_handle(struct memory_handle *h) } } - memset(h, 0, sizeof(struct memory_handle)); + /* Invalidate the cache to prevent it from keeping the old location of h */ + if (h == cached_handle) + cached_handle = NULL; + num_handles--; mutex_unlock(&llist_mutex); -- 2.11.4.GIT