diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-05-18 07:58:47 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-05-18 07:58:47 +0000 |
commit | f2ef614d5e97931697346705cbd094b4bba8741c (patch) | |
tree | d9b45548ae7a20f1b0ee2517a603e9b996f10ad7 | |
parent | 66ccd31e5b583a7dbeb90be98bfd3c0d6be688d6 (diff) |
Plug a minor memory leak associated with kn_get_licensees(), and make
the latter work before a query has been issued.
-rw-r--r-- | lib/libkeynote/environment.c | 6 | ||||
-rw-r--r-- | lib/libkeynote/keynote.l | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/libkeynote/environment.c b/lib/libkeynote/environment.c index 6504b99598d..f612501060b 100644 --- a/lib/libkeynote/environment.c +++ b/lib/libkeynote/environment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: environment.c,v 1.9 1999/10/26 22:31:38 angelos Exp $ */ +/* $OpenBSD: environment.c,v 1.10 2000/05/18 07:58:45 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -1035,5 +1035,9 @@ kn_get_licensees(int sessid, int assertid) return (struct keynote_keylist *) NULL; } + if (as->as_keylist == NULL) + if (keynote_parse_keypred(as, 1) != RESULT_TRUE) + return (struct keynote_keylist *) NULL; + return (struct keynote_keylist *) as->as_keylist; } diff --git a/lib/libkeynote/keynote.l b/lib/libkeynote/keynote.l index ca97a1ed513..d0fd6e11a29 100644 --- a/lib/libkeynote/keynote.l +++ b/lib/libkeynote/keynote.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: keynote.l,v 1.8 2000/02/18 13:36:13 angelos Exp $ */ +/* $OpenBSD: keynote.l,v 1.9 2000/05/18 07:58:46 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -526,7 +526,7 @@ keynote_evaluate_assertion(struct assertion *as) /* * Parse/evaluate a key predicate field. - * Store keys in key predicate as keylist in as->as_keylist, if third + * Store keys in key predicate as keylist in as->as_keylist, if second * argument is true. */ int @@ -581,7 +581,9 @@ keynote_parse_keypred(struct assertion *as, int record) keynote_used_variable = 0; as->as_internalflags |= ASSERT_IFLAG_WEIRDLICS; } - + + if (as->as_keylist) + keynote_keylist_free(as->as_keylist); as->as_keylist = keynote_keypred_keylist; keynote_keypred_keylist = (struct keylist *) NULL; return RESULT_TRUE; |