[augeas-devel] augeas: master - * src/augeas.c: use ALLOC instead of CALLOC

David Lutterkort lutter at fedoraproject.org
Mon Feb 2 06:10:32 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=cca1376bd52708eb5107cae6c4be8b4373cc10e8
Commit:        cca1376bd52708eb5107cae6c4be8b4373cc10e8
Parent:        d332e882c89efb03e78814810a425b2b30e56140
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Sun Feb 1 22:09:57 2009 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Sun Feb 1 22:09:57 2009 -0800

* src/augeas.c: use ALLOC instead of CALLOC

---
 src/augeas.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/augeas.c b/src/augeas.c
index d61c34c..98bee5f 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -362,8 +362,7 @@ int aug_insert(struct augeas *aug, const char *path, const char *label,
 struct tree *make_tree(char *label, char *value, struct tree *parent,
                        struct tree *children) {
     struct tree *tree;
-    CALLOC(tree, 1);
-    if (tree == NULL)
+    if (ALLOC(tree) < 0)
         return NULL;
 
     tree->label = label;
@@ -570,8 +569,7 @@ int aug_match(const struct augeas *aug, const char *pathin, char ***matches) {
     if (matches == NULL)
         return cnt;
 
-    CALLOC(*matches, cnt);
-    if (*matches == NULL)
+    if (ALLOC_N(*matches, cnt) < 0)
         goto error;
 
     int i = 0;




More information about the augeas-devel mailing list