From: Karel Zak Date: Fri, 29 Oct 2010 11:29:28 +0000 (+0200) Subject: remove free() from atexit() callbacks X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d757a9fdeab9bc3be5c9181abe28b3afe0bd199;p=util-linux remove free() from atexit() callbacks Signed-off-by: Karel Zak --- 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; -}