isl_input.c: accept_affine: fix memory leak on error path
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 21 Feb 2010 21:41:06 +0000 (22:41 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 4 Mar 2010 09:03:48 +0000 (10:03 +0100)
isl_input.c

index c6ca654..12838bf 100644 (file)
@@ -170,6 +170,7 @@ static struct isl_vec *accept_affine(struct isl_stream *s, struct vars *v)
                                goto error;
                        if (pos >= n) {
                                isl_stream_error(s, tok, "unknown identifier");
+                               isl_token_free(tok);
                                goto error;
                        }
                        if (sign > 0)
@@ -191,6 +192,7 @@ static struct isl_vec *accept_affine(struct isl_stream *s, struct vars *v)
                                if (pos >= n) {
                                        isl_stream_error(s, tok2,
                                                "unknown identifier");
+                                       isl_token_free(tok);
                                        isl_token_free(tok2);
                                        goto error;
                                }