Skip to content

Commit

Permalink
Fix memory leak in trim().
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Jan 3, 2021
1 parent c66af56 commit e8e3f7e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,7 @@ ctr_object* ctr_string_trim(ctr_object* myself, ctr_argument* argumentList) {
if (len == 0) return ctr_build_empty_string();
i = 0;
while(i < len && isspace(*(str+i))) i++;
if (i == len) return ctr_build_empty_string();
begin = i;
i = len - 1;
while(i > begin && isspace(*(str+i))) i--;
Expand Down

0 comments on commit e8e3f7e

Please sign in to comment.