staticlibs / ccronexpr

Cron expression parsing in ANSI C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak in `to_string`?

alfred-ai opened this issue · comments

CppCheck reported a memory leak here:

int res = sprintf(str, "%d", num);

This is really a leak according to my understand of the code, where the memory is gone in case sprintf failed.

Agree, looks like a real leak, cron_free should be added into the res < 0 check. I can merge a PR for that or can add this change myself (will take a couple of days).