You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A pointer variable named dst is defined at line 3461 in the file /zstd/lib/compress/zstd_compress.c and a new dynamic memory area is allocated to it using the function ZSTD_customMalloc. If the RETURN_ERROR_IF macro condition at line 3466 is met, the function will return at this line, and the release operation of the dynamic memory area pointed to by dst at line 3484 will not be executed, resulting in a memory leak, as shown in the figure below: https://github.com/LuMingYinDetect/zstd_defects/blob/main/zstd_1.png
The text was updated successfully, but these errors were encountered:
Adenilson
pushed a commit
to Adenilson/zstd
that referenced
this issue
Aug 7, 2024
Sanity checks on a few of the context parameters (i.e. workers and block size)
may prompt an early return on ZSTD_generateSequences.
Allocating the destination buffer past those return points avoids a potential
memory leak.
This patch should fix issue facebook#4112.
Sanity checks on a few of the context parameters (i.e. workers and block size)
may prompt an early return on ZSTD_generateSequences.
Allocating the destination buffer past those return points avoids a potential
memory leak.
This patch should fix issue facebook#4112.
Adenilson
pushed a commit
to Adenilson/zstd
that referenced
this issue
Aug 7, 2024
Sanity checks on a few of the context parameters (i.e. workers and block size)
may prompt an early return on ZSTD_generateSequences.
Allocating the destination buffer past those return points avoids a potential
memory leak.
This patch should fix issue facebook#4112.
A pointer variable named dst is defined at line 3461 in the file /zstd/lib/compress/zstd_compress.c and a new dynamic memory area is allocated to it using the function ZSTD_customMalloc. If the RETURN_ERROR_IF macro condition at line 3466 is met, the function will return at this line, and the release operation of the dynamic memory area pointed to by dst at line 3484 will not be executed, resulting in a memory leak, as shown in the figure below:
https://github.com/LuMingYinDetect/zstd_defects/blob/main/zstd_1.png
The text was updated successfully, but these errors were encountered: