Skip to content
Permalink
Browse files

Merge pull request #8 from marado/sds-free

sdsfree everything before return'ing
  • Loading branch information...
amnuts committed Apr 10, 2019
2 parents a3c904e + eb86e9d commit 8b420a409c03e8f788f8b00d14433dbd42cabb21
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/amnuts230.c
@@ -4030,6 +4030,7 @@ dump_commands(int sig)
filename = sdscatfmt(sdsempty(), "%s/%s.%s", LOGFILES, LAST_CMD, dstr);
fp = fopen(filename, "w");
if (!fp) {
sdsfree(filename);
return;
}
fprintf(fp, "Caught signal %d:\n\n", sig);
@@ -4303,6 +4304,7 @@ add_history(char *username, int showtime, const char *str, ...)
filename = sdscatfmt(sdsempty(), "%s/%s/%s.H", USERFILES, USERHISTORYS, username);
fp = fopen(filename, "a");
if (!fp) {
sdsfree(filename);
return;
}
time(&now);

0 comments on commit 8b420a4

Please sign in to comment.
You can’t perform that action at this time.