K 10 svn:author V 4 ngie K 8 svn:date V 27 2016-07-14T15:46:41.021146Z K 7 svn:log V 1170 Fix ports-mgmt/portfind string management/searching issues Makefile: Bump `PORT_REVISION` for the change. portfind.c: get_release(..): The function was incorrectly modifying a pointer that wasn't the original calloc'ed pointer, tripping asserts when MALLOC_PRODUCTION wasn't enabled in jemalloc [*]. - Use one temporary buffer (`release`) instead of two (`release` and `version`). - Improve temporary memory idiom for managing memory used with sysctlbyname(3) by first checking the length, mallocing the buffer, then filling it with a second call to sysctlbyname(3). - Use strchr(3) instead of handrolling it in a while-loop and to avoid the improper free(3) of the memory allocated for `release`. main(..): - Use asprintf instead of calloc + sprintf. - Use constant `pasting` with `INDEX_FILE` instead of passing it in to asprintf(3). - Fix error message when unable to open `INDEX_FILE`. Approved by: brd Differential Revision: https://reviews.freebsd.org/D7198 PR: 211032 [*] Reported by: Michael Zhilin Reviewed by: Michael Zhilin Sponsored by: EMC / Isilon Storage Division END