[Crosstoolchain-logs] [device-tree-compiler] 126/198: Consistently use xrealloc instead of realloc

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:07:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.4.x
in repository device-tree-compiler.

commit 8ce36476ae8d2541e9bf3a6c23c345ec03694ee3
Author: Heinrich Schuchardt <xypron.glpk at gmx.de>
Date:   Sun Mar 2 21:39:01 2014 +0100

    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 at gmx.de>
---
 fdtput.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fdtput.c b/fdtput.c
index 5226a4e..2a8d674 100644
--- a/fdtput.c
+++ b/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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list