rem: if (wstate->instance) free(wstate->instance); if (wstate->class)    free(wstate->class); if (wstate->command)  free(wstate->command); free(wstate->state); free(wstate);
add: if (wstate->instance) wfree(wstate->instance); if (wstate->class)    wfree(wstate->class); if (wstate->command)  wfree(wstate->command); wfree(wstate->state); wfree(wstate);
context: wWindowDeleteSavedStatesForPID(pid_t pid){    WWindowState *tmp, *wstate;    if (!windowState)        return;    tmp = windowState;    if (tmp->pid == pid) {	wstate = windowState;        windowState = tmp->next;#ifdef DEBUG        printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",               wstate, wstate->instance, wstate->class, wstate->command);#endif        if (wstate->instance) free(wstate->instance);        if (wstate->class)    free(wstate->class);        if (wstate->command)  free(wstate->command);        free(wstate->state);        free(wstate);    } else {	while (tmp->next) {	    if (tmp->next->pid==pid) {		wstate = tmp->next;		tmp->next = wstate->next;#ifdef DEBUG                printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",                       wstate, wstate->instance, wstate->class, wstate->command);#endif                if (wstate->instance) free(wstate->instance);                if (wstate->class)    free(wstate->class);                if (wstate->command)  free(wstate->command);                free(wstate->state);                free(wstate);		break;	    }	    tmp = tmp->next;	}    }    }