I'm not totally sure about this -- does the return value of var_get_type need to be freed? If so, there are some other places in mi-cmd-var where it isn't being.