diff options
| author | Alex Pickering <alexandermpickering@gmail.com> | 2019-09-28 16:06:47 -0400 |
|---|---|---|
| committer | Alex Pickering <alexandermpickering@gmail.com> | 2019-09-28 16:06:47 -0400 |
| commit | 51aa0fd15c327c0ef20242b00b02bda169af4744 (patch) | |
| tree | 707a44c28cfbbaf47916906b1ef95ecea95ac236 /src/kmp.c | |
| parent | d8987084b7aa3c47642af30a87c0673a2df01fd0 (diff) | |
| download | libctemplates-51aa0fd15c327c0ef20242b00b02bda169af4744.tar.gz libctemplates-51aa0fd15c327c0ef20242b00b02bda169af4744.tar.bz2 libctemplates-51aa0fd15c327c0ef20242b00b02bda169af4744.zip | |
Fixed memory corruption bugs
Fixed various memory corruption bugs in the parsing step
Diffstat (limited to 'src/kmp.c')
| -rw-r--r-- | src/kmp.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -26,6 +26,8 @@ int kmp(const char* t,size_t tlen, const char* p,size_t plen) { while (i < n) { if (t[i] == p[j]) { if (j == m - 1) { + + free(f); return i - j; } else { @@ -43,6 +45,7 @@ int kmp(const char* t,size_t tlen, const char* p,size_t plen) { } } + free(f); return -1; } |
