login_cap(3) states: Note that with all functions in this group, you should not call free(3) on any pointers returned. Memory allocated during retrieval or process- ing of capability tags is automatically reused by subsequent calls to functions in this group, or deallocated on calling login_close(). this is incorrect. Functions like login_getcapstr() simply return either the default passed to them or the string malloc'd by cgetstr(). No book keeping is done to ensure that that string is free()'d when needed. Actually implementing the above promise is probably a tall order. It might be better to document which functions do indeed need free() called and with the warning that one should use variables for default values so that one can later tell if free is needed or not. Alternatively login_getcapstr() could strdup(def), so that free() is always needed.
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped