Skip to content

Commit 37136e9

Browse files
committed
fix memory leak
No need to free it if we use the stack! closes: #54
1 parent caf0287 commit 37136e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parsley.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4359,8 +4359,8 @@ bool APar_Readjust_TFHD_fragment_atom(uint64_t mdat_position,
43594359
parsedAtoms[tfhd_number].AtomicStart + 12,
43604360
parsedAtoms[tfhd_number].AtomicLength - 12);
43614361

4362-
char *tfhd_atomFlags_scrap = (char *)malloc(sizeof(char) * 10);
4363-
memset(tfhd_atomFlags_scrap, 0, 10);
4362+
char tfhd_atomFlags_scrap[10];
4363+
memset(tfhd_atomFlags_scrap, 0, sizeof(tfhd_atomFlags_scrap));
43644364
// parsedAtoms[tfhd_number].AtomicVerFlags = APar_read32(tfhd_atomFlags_scrap,
43654365
// source_file, parsedAtoms[tfhd_number].AtomicStart+8);
43664366

0 commit comments

Comments
 (0)