OSDN Git Service

config parser: do not assume that realloc return same pointer
authorNatanael Copa <natanael.copa@gmail.com>
Thu, 14 Oct 2010 06:35:04 +0000 (06:35 +0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thu, 14 Oct 2010 12:59:55 +0000 (14:59 +0200)
commit54187ed0f082d145955a932f67259668dd038f65
treeccd7f4363ab353528e981502536e5e56bdbc7d8d
parentc50d27fa8b1f62ebf9853a641dcf38a90ed33d38
config parser: do not assume that realloc return same pointer

We need to update the parser->line pointer on realloc and do not
initialize the token array til after the potensial realloc in
bb_get_chunk_with_continuation().

While here, also replace a realloc() with malloc() where pointer always
is NULL.

Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/misc/internals/parse_config.c