Browse Source

Initialize search context before use.

master
samr7 13 years ago
parent
commit
7c7caf5eec
  1. 2
      pattern.c

2
pattern.c

@ -1781,6 +1781,7 @@ vg_prefix_context_new(int addrtype, int privtype, int caseinsensitive)
vcpp = (vg_prefix_context_t *) malloc(sizeof(*vcpp)); vcpp = (vg_prefix_context_t *) malloc(sizeof(*vcpp));
if (vcpp) { if (vcpp) {
memset(vcpp, 0, sizeof(*vcpp));
vcpp->base.vc_addrtype = addrtype; vcpp->base.vc_addrtype = addrtype;
vcpp->base.vc_privtype = privtype; vcpp->base.vc_privtype = privtype;
vcpp->base.vc_npatterns = 0; vcpp->base.vc_npatterns = 0;
@ -2022,6 +2023,7 @@ vg_regex_context_new(int addrtype, int privtype)
vcrp = (vg_regex_context_t *) malloc(sizeof(*vcrp)); vcrp = (vg_regex_context_t *) malloc(sizeof(*vcrp));
if (vcrp) { if (vcrp) {
memset(vcrp, 0, sizeof(*vcrp));
vcrp->base.vc_addrtype = addrtype; vcrp->base.vc_addrtype = addrtype;
vcrp->base.vc_privtype = privtype; vcrp->base.vc_privtype = privtype;
vcrp->base.vc_npatterns = 0; vcrp->base.vc_npatterns = 0;

Loading…
Cancel
Save