Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks #16

Merged
merged 2 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/zps.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ static int formatStatContent(char *statContent) {
}
/* Update the original file content and deallocate the memory. */
strcpy(statContent, contentDup);
free(contentDup);
}
free(contentDup);
}
regfree(&regex);
return EXIT_SUCCESS;
}

Expand Down
5 changes: 5 additions & 0 deletions src/zps.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef ZPS_H
#define ZPS_H

#define VERSION "1.2.8" /* Version */
#define _XOPEN_SOURCE 700 /* POSIX.1-2008 + XSI (SuSv4) */
#define _LARGEFILE64_SOURCE /* Enable LFS */
Expand All @@ -32,3 +35,5 @@
#define CLR_DEFAULT "\x1b[0m" /* Default color and style attributes */
#define CLR_BOLD "\x1b[1m" /* Bold attribute */
#define CLR_RED "\x1b[31m" /* Color red */

#endif // ZPS_H
Loading