diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-02-08 10:05:09 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-02-08 10:05:09 +0000 |
commit | d585b66fa4d11059948f466c9080a6826932358d (patch) | |
tree | 8b06692920852c297635b46a7d616c3066f95fac /stdlib/fmtmsg.c | |
parent | e7cbcee4982d8caa809a91c9cfef5fda67445f0a (diff) | |
download | glibc-d585b66fa4d11059948f466c9080a6826932358d.tar.gz glibc-d585b66fa4d11059948f466c9080a6826932358d.tar.xz glibc-d585b66fa4d11059948f466c9080a6826932358d.zip |
Updated to fedora-glibc-20050208T0948 cvs/fedora-glibc-2_3_4-6
Diffstat (limited to 'stdlib/fmtmsg.c')
-rw-r--r-- | stdlib/fmtmsg.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c index 2ab97b7d90..b5d7436956 100644 --- a/stdlib/fmtmsg.c +++ b/stdlib/fmtmsg.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997,1999,2000,2001,2002,2003 Free Software Foundation, Inc. +/* Copyright (C) 1997,1999,2000-2003,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -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 @@ -324,9 +324,6 @@ internal_addseverity (int severity, const char *string) if (runp != NULL) { - /* Release old string. */ - free ((char *) runp->string); - if (string != NULL) /* Change the string. */ runp->string = string; @@ -367,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); @@ -411,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); } |