+ if (!(thenode = (struct searchNode *)malloc(sizeof (struct searchNode)))) {
+ /* couldn't malloc() memory for thenode, so free the pcre's and localdata to avoid leakage */
+ parseError = "malloc: could not allocate memory for this search.";
+ if (localdata->pcre_extra)
+ pcre_free(localdata->pcre_extra);
+
+ if (localdata->pcre)
+ pcre_free(localdata->pcre);
+
+ free(localdata);
+ return NULL;
+ }