From 792dcd77cdafb46c746119e250a5ba9d20598f8f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 26 Jan 2005 00:01:20 +0000 Subject: Update. 2005-01-25 Jakub Jelinek * stdlib/fmtmsg.c (addseverity): Remove new_string variable. (free_mem): Don't free string. * stdlib/tst-fmtmsg.c: Include string.h. (main): Add some more tests. 2005-01-25 Andreas Schwab * timezone/asia: Update from tzdata2005c. * timezone/backward: Likewise. * timezone/leapseconds: Likewise. * timezone/northamerica: Likewise. * timezone/southamerica: Likewise. * timezone/private.h: Update from tzcode2005c. * timezone/tzfile.h: Likewise. * timezone/zdump.c: Likewise. * timezone/zic.c: Likewise. --- stdlib/fmtmsg.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'stdlib/fmtmsg.c') diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c index 9e654c688e..b5d7436956 100644 --- a/stdlib/fmtmsg.c +++ b/stdlib/fmtmsg.c @@ -316,7 +316,7 @@ internal_addseverity (int severity, const char *string) int result = MM_OK; /* First see if there is already a record for the severity level. */ - for (runp = severity_list, lastp = NULL; runp != NULL; runp = runp-> next) + for (runp = severity_list, lastp = NULL; runp != NULL; runp = runp->next) if (runp->severity == severity) break; else @@ -364,34 +364,17 @@ int addseverity (int severity, const char *string) { int result; - const char *new_string; /* Prevent illegal SEVERITY values. */ if (severity <= MM_INFO) return MM_NOTOK; - if (string == NULL) - /* We want to remove the severity class. */ - new_string = NULL; - else - { - new_string = __strdup (string); - - if (new_string == NULL) - /* Allocation failed or illegal value. */ - return MM_NOTOK; - } - /* Protect the global data. */ __libc_lock_lock (lock); /* Do the real work. */ result = internal_addseverity (severity, string); - if (result != MM_OK) - /* Free the allocated string. */ - free ((char *) new_string); - /* Release the lock. */ __libc_lock_unlock (lock); @@ -408,7 +391,6 @@ libc_freeres_fn (free_mem) { /* This is data we have to release. */ struct severity_info *here = runp; - free ((char *) runp->string); runp = runp->next; free (here); } -- cgit 1.4.1