Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 6e1c867

Browse files
committed
1.1.1: fix memory leak (text) (sonarcloud)
1 parent 0d453cb commit 6e1c867

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cmd-sh.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ void *ShRunFunc(void *argp) {
4343
sprintf(buf, "codybot::ShRunFunc() error: Cannot open prog.sh: %s",
4444
strerror(errno));
4545
Msg(buf);
46+
free(text);
4647
return NULL;
4748
}
4849
fputs(text, fp);
@@ -58,6 +59,7 @@ void *ShRunFunc(void *argp) {
5859
sprintf(buf, "codybot::ShRunFunc() error: Cannot open cmd.ret: %s",
5960
strerror(errno));
6061
Msg(buf);
62+
free(text);
6163
return NULL;
6264
}
6365
fgets(buf, 4096, fp);

0 commit comments

Comments
 (0)