Consistently use xrealloc instead of realloc
fdtput.c: Replace the remaining call to realloc by xrealloc. Some redundant lines in encode_value can be saved. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
821acd4c17
commit
8ce36476ae
1 changed files with 1 additions and 6 deletions
7
fdtput.c
7
fdtput.c
|
@ -96,12 +96,7 @@ static int encode_value(struct display_info *disp, char **arg, int arg_count,
|
|||
/* enlarge our value buffer by a suitable margin if needed */
|
||||
if (upto + len > value_size) {
|
||||
value_size = (upto + len) + 500;
|
||||
value = realloc(value, value_size);
|
||||
if (!value) {
|
||||
fprintf(stderr, "Out of mmory: cannot alloc "
|
||||
"%d bytes\n", value_size);
|
||||
return -1;
|
||||
}
|
||||
value = xrealloc(value, value_size);
|
||||
}
|
||||
|
||||
ptr = value + upto;
|
||||
|
|
Loading…
Reference in a new issue