--- code/trunk/pcredemo.c 2007/02/24 21:40:37 75 +++ code/trunk/pcredemo.c 2007/03/05 12:36:47 97 @@ -16,6 +16,10 @@ */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -117,7 +121,7 @@ */ default: printf("Matching error %d\n", rc); break; } - free(re); /* Release memory used for the compiled pattern */ + pcre_free(re); /* Release memory used for the compiled pattern */ return 1; } @@ -223,8 +227,8 @@ if (!find_all) { - free(re); /* Release the memory used for the compiled pattern */ - return 0; /* Finish unless -g was given */ + pcre_free(re); /* Release the memory used for the compiled pattern */ + return 0; /* Finish unless -g was given */ } /* Loop for second and subsequent matches */ @@ -276,7 +280,7 @@ if (rc < 0) { printf("Matching error %d\n", rc); - free(re); /* Release memory used for the compiled pattern */ + pcre_free(re); /* Release memory used for the compiled pattern */ return 1; } @@ -317,7 +321,7 @@ } /* End of loop to find second and subsequent matches */ printf("\n"); -free(re); /* Release memory used for the compiled pattern */ +pcre_free(re); /* Release memory used for the compiled pattern */ return 0; }