In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix potential double free in createvarref()
In createvarref(), initvarref() is called to initialize the fields of variable reffield, which is allocated in the previous function call to createhistfield(). Function initvarref() allocates the corresponding fields such as reffield->system, but frees these fields when the function encounters an error. The caller later calls destroyhistfield() to conduct error handling, which frees the fields and the variable itself. This results in double free of the fields which are already freed in the previous function.
Fix this by storing NULL to the corresponding fields when they are freed in initvarref().