OSDN Git Service

sgetspent: add missing free/__uc_malloc calls
authorDenis Vlasenko <vda.linux@googlemail.com>
Wed, 1 Aug 2007 10:19:51 +0000 (10:19 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Wed, 1 Aug 2007 10:19:51 +0000 (10:19 -0000)
(spotted by Peter S. Mazinger <ps.m@gmx.net>)

libc/pwd_grp/pwd_grp.c

index 7715160..ab6f8f0 100644 (file)
@@ -729,6 +729,8 @@ struct spwd *sgetspent(const char *string)
        } *sp;
        struct spwd *result;
 
+       free(sp);
+       sp = __uc_malloc(sizeof(*sp));
        sgetspent_r(string, &sp->spwd, sp->line_buff, sizeof(sp->line_buff), &result);
        return result;
 }