coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] df: use proper pointer size for xnrealloc


From: Bernhard Voelker
Subject: [PATCH] df: use proper pointer size for xnrealloc
Date: Tue, 15 Apr 2014 23:06:40 +0200

* src/df.c (alloc_table_row): Use the size of char** to enlarge
the table.  Spotted by Coverity.
---
 src/df.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/df.c b/src/df.c
index 3036c74..e763943 100644
--- a/src/df.c
+++ b/src/df.c
@@ -290,7 +290,7 @@ static void
 alloc_table_row (void)
 {
   nrows++;
-  table = xnrealloc (table, nrows, sizeof (char *));
+  table = xnrealloc (table, nrows, sizeof (char **));
   table[nrows - 1] = xnmalloc (ncolumns, sizeof (char *));
 }
 
-- 
1.8.4.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]