From 5d757a9fdeab9bc3be5c9181abe28b3afe0bd199 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 29 Oct 2010 13:29:28 +0200 Subject: [PATCH] remove free() from atexit() callbacks Signed-off-by: Karel Zak --- disk-utils/mkswap.c | 6 ------ text-utils/ul.c | 7 ------- 2 files changed, 13 deletions(-) diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index 93378076..246b8dd7 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -174,11 +174,6 @@ init_signature_page(void) { } } -static void -deinit_signature_page(void) { - free(signature_page); -} - static void write_signature(char *sig) { char *sp = (char *) signature_page; @@ -538,7 +533,6 @@ main(int argc, char ** argv) { #endif init_signature_page(); /* get pagesize */ - atexit(deinit_signature_page); if (!device_name) { fprintf(stderr, diff --git a/text-utils/ul.c b/text-utils/ul.c index dbcc3214..ab0a6e77 100644 --- a/text-utils/ul.c +++ b/text-utils/ul.c @@ -78,7 +78,6 @@ void outc(wint_t c, int width); void setmode(int newmode); static void setcol(int newcol); static void needcol(int col); -static void exitbuf(void); static void sig_handler(int signo); #define IESC '\033' @@ -169,7 +168,6 @@ int main(int argc, char **argv) if ( (tigetflag("os") && ENTER_BOLD==NULL ) || (tigetflag("ul") && ENTER_UNDERLINE==NULL && UNDER_CHAR==NULL)) must_overstrike = 1; - atexit(exitbuf); initbuf(); if (optind == argc) filter(stdin); @@ -607,8 +605,3 @@ static void sig_handler(int signo) _exit(EXIT_SUCCESS); } -static void exitbuf(void) -{ - free(obuf); - obuf = NULL; -} -- 2.39.5