[augeas-devel] augeas: master - * src/augeas.c (init_root): check for failure of strdup
David Lutterkort
lutter at fedoraproject.org
Mon Feb 2 05:57:14 UTC 2009
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=b3644ee99394eba61758080796744386d835c4b4
Commit: b3644ee99394eba61758080796744386d835c4b4
Parent: cbb33c84bad6275a40697d1dd6a1d45cc11a14a2
Author: David Lutterkort <lutter at redhat.com>
AuthorDate: Sun Feb 1 21:33:15 2009 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Sun Feb 1 21:44:02 2009 -0800
* src/augeas.c (init_root): check for failure of strdup
---
src/augeas.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/augeas.c b/src/augeas.c
index a319683..c092ec2 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -157,6 +157,8 @@ static const char *init_root(const char *root0) {
if (root0 == NULL)
root0 = "/";
root = strdup(root0);
+ if (root == NULL)
+ return NULL;
if (root[strlen(root)-1] != SEP) {
if (REALLOC_N(root, strlen(root) + 2) == -1) {
FREE(root);
More information about the augeas-devel
mailing list