--- src/sys/dev/misc/syscons/scvtb.c 2005/05/26 16:24:33 1.6 +++ src/sys/dev/misc/syscons/scvtb.c 2005/09/24 14:40:00 1.7 @@ -80,16 +80,20 @@ sc_vtb_init(sc_vtb_t *vtb, int type, int void sc_vtb_destroy(sc_vtb_t *vtb) { + uint16_t *p; + vtb->vtb_cols = 0; vtb->vtb_rows = 0; vtb->vtb_size = 0; vtb->vtb_tail = 0; + + p = vtb->vtb_buffer; vtb->vtb_buffer = NULL; switch (vtb->vtb_type) { case VTB_MEMORY: case VTB_RINGBUFFER: - if ((vtb->vtb_flags & VTB_ALLOCED) && (vtb->vtb_buffer != NULL)) - free(vtb->vtb_buffer, M_SYSCONS); + if ((vtb->vtb_flags & VTB_ALLOCED) && (p != NULL)) + free(p, M_SYSCONS); break; default: break;