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

[augeas-devel] augeas: master - * src/fa.c (fa_intersect): initialize vars that could be used on error



Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=b3c214a0b3f393c090f77ae7a0401250a652cb17
Commit:        b3c214a0b3f393c090f77ae7a0401250a652cb17
Parent:        3a2afb2c05290f2521ee0d320619a3f702d05f13
Author:        David Lutterkort <lutter redhat com>
AuthorDate:    Thu Jan 14 10:44:45 2010 -0800
Committer:     David Lutterkort <lutter redhat com>
CommitterDate: Thu Jan 14 10:44:45 2010 -0800

* src/fa.c (fa_intersect): initialize vars that could be used on error

---
 src/fa.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/fa.c b/src/fa.c
index 067c96f..84c15af 100644
--- a/src/fa.c
+++ b/src/fa.c
@@ -2193,6 +2193,9 @@ static void sort_transition_intervals(struct fa *fa) {
 
 struct fa *fa_intersect(struct fa *fa1, struct fa *fa2) {
     int ret;
+    struct fa *fa = NULL;
+    struct state_set *worklist = NULL;
+    state_triple_hash *newstates = NULL;
 
     if (fa1 == fa2)
         return fa_clone(fa1);
@@ -2205,9 +2208,9 @@ struct fa *fa_intersect(struct fa *fa1, struct fa *fa2) {
         _F(case_expand(fa2));
     }
 
-    struct fa *fa = fa_make_empty();
-    struct state_set *worklist = state_set_init(-1, S_NONE);
-    state_triple_hash *newstates = state_triple_init();
+    fa = fa_make_empty();
+    worklist = state_set_init(-1, S_NONE);
+    newstates = state_triple_init();
     if (fa == NULL || worklist == NULL || newstates == NULL)
         goto error;
 



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