libpwdgrp: store getXXnam result in a single malloc block
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 3 Jan 2015 19:47:47 +0000 (20:47 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 3 Jan 2015 19:47:47 +0000 (20:47 +0100)
commit134c53098bdcbf7a0c34b60b97c46280d86eb48f
tree7c149d5eeb92085183e928908d8a648142fc4bb1
parent20c0a16334e96493077eaaad6f4c5690af0aa6e8
libpwdgrp: store getXXnam result in a single malloc block

This saves a bit of memory but more importantly, allows to create
xmalloc_getpwnam() API where result can be deleted simply using free().

function                                             old     new   delta
getXXnam                                             134     173     +39
parse_common                                         188     212     +24
convert_to_struct                                    277     290     +13
get_S                                                 90      88      -2
tokenize                                             129     126      -3
bb_internal_getpwent_r                               175     172      -3
getXXnam_r                                           208     198     -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/4 up/down: 76/-18)             Total: 58 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libpwdgrp/pwd_grp.c