Browse code

matcher-ac: fix error case handling

Kevin Lin authored on 2016/07/13 01:46:16
Showing 1 changed files
... ...
@@ -2587,8 +2587,9 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
2587 2587
 
2588 2588
             if (nest > ACPATT_ALTN_MAXNEST) {
2589 2589
                 cli_errmsg("ac_addspecial: Expression exceeds maximum alternate nesting limit\n");
2590
-                free(hexcpy);
2591
-                return CL_EMALFDB;
2590
+                mpool_free(root->mempool, newspecial);
2591
+                error = CL_EMALFDB;
2592
+                break;
2592 2593
             }
2593 2594
 
2594 2595
             if(!strcmp(pt, "B")) {