[augeas-devel] augeas: master - * augeas.c (aug_init): check an allocation failure
David Lutterkort
lutter at fedoraproject.org
Mon Feb 2 05:57:21 UTC 2009
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=d332e882c89efb03e78814810a425b2b30e56140
Commit: d332e882c89efb03e78814810a425b2b30e56140
Parent: cd1f54c7f597864eddb897970e49a32f233a3d83
Author: David Lutterkort <lutter at redhat.com>
AuthorDate: Sat Jan 10 21:33:24 2009 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Sun Feb 1 21:48:38 2009 -0800
* augeas.c (aug_init): check an allocation failure
---
src/augeas.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/augeas.c b/src/augeas.c
index c092ec2..d61c34c 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -177,7 +177,8 @@ struct augeas *aug_init(const char *root, const char *loadpath,
if (tree_root == NULL)
return NULL;
- CALLOC(result, 1);
+ if (ALLOC(result) < 0)
+ goto error;
result->origin = make_tree_origin(tree_root);
if (result->origin == NULL) {
free_tree(tree_root);
More information about the augeas-devel
mailing list