Skip to content
Commit 9afdd612 authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Kalle Valo
Browse files

cw1200: Don't leak memory if krealloc failes



The call to krealloc() in wsm_buf_reserve() directly assigns the newly
returned memory to buf->begin. This is all fine except when krealloc()
failes we loose the ability to free the old memory pointed to by
buf->begin. If we just create a temporary variable to assign memory to
and assign the memory to it we can mitigate the memory leak.

Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 424342ff
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment