I have a better idea. Why don't I make the interface csgetvalue(char *netroot, char *attr, char *val, char *rattr, char **pp); If buf is non-zero, I strdup a reply and sick a pointer to it in pp. Given how much these routines to, it probably doesn't hurt to do the extra malloc/free.