Browse Source

sgetspent: add missing free/__uc_malloc calls
(spotted by Peter S. Mazinger <ps.m@gmx.net>)

Denis Vlasenko 17 years ago
parent
commit
1007c6844b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libc/pwd_grp/pwd_grp.c

+ 2 - 0
libc/pwd_grp/pwd_grp.c

@@ -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;
 }