diff --git a/src/pkg-psyc.c b/src/pkg-psyc.c index 85a993d..712f21f 100644 --- a/src/pkg-psyc.c +++ b/src/pkg-psyc.c @@ -127,6 +127,8 @@ f_psyc_parse (svalue_t *sp) { state = pxalloc(sizeof(psyc_state_t)); if (!state) errorf("Out of memory for psyc state struct.\n"); O_GET_PSYC_STATE(current_object) = state; + memset(state, 0, sizeof(psyc_state_t)); + state->parser = pxalloc(sizeof(psycParseState)); if (!state->parser) errorf("Out of memory for psyc parse state struct.\n"); psyc_initParseState(state->parser); @@ -161,6 +163,7 @@ f_psyc_parse (svalue_t *sp) { if (state->remaining) { pfree(state->remaining); + state->remaining = NULL; state->remaining_len = 0; } @@ -267,6 +270,7 @@ f_psyc_parse (svalue_t *sp) { break; case PSYC_PARSE_COMPLETE: + state->packet = NULL; ret = 0; break; case PSYC_PARSE_INSUFFICIENT: diff --git a/src/pkg-psyc.h b/src/pkg-psyc.h index caccc21..e010d42 100644 --- a/src/pkg-psyc.h +++ b/src/pkg-psyc.h @@ -44,6 +44,7 @@ psyc_free_state (psyc_state_t *ps) { pfree((void *) ps->parser); if (ps->packet) free_array(ps->packet); + ps->name = ps->value = ps->remaining = ps->parser = ps->packet = NULL; ps->oper = ps->name_len = ps->value_len = ps->remaining_len = 0; } diff --git a/src/version.sh b/src/version.sh index 6577aa5..d7a9f61 100644 --- a/src/version.sh +++ b/src/version.sh @@ -17,7 +17,7 @@ version_longtype="stable" # A timestamp, to be used by bumpversion and other scripts. # It can be used, for example, to 'touch' this file on every build, thus # forcing revision control systems to add it on every checkin automatically. -version_stamp="Mon May 9 21:22:33 CEST 2011" +version_stamp="Tue May 10 01:00:33 CEST 2011" # Okay, LDMUD is using 3.x.x so to avoid conflicts let's just use 4.x.x version_major=4