cnxcc: fixed deadlock when call gets terminated under certain conditions

- fixed some indentation problems introduced by Eclipse IDE

(cherry picked from commit d0f0ba702bd44524bc9f52e07341db03267b15f7)
mem/f_malloc: check returned pointer for bitmask index

- if null, reset slot and search on bigger chunks slots

(cherry picked from commit 892a24f7256e60e2a0116655e0052c284479b7d2)
mem/f_malloc: free old pointer if allocation in realloc fails

(cherry picked from commit 41a37b570758445d723d4d78b9786f8e6cb5722c)
mem/q_malloc: free old pointer if allocation in realloc fails

(cherry picked from commit 8c2888fcd33bee45cb4654222da619e70ed44ecc)
dialog: if sending BYE fails at timeout, unref dialog

- destroy dialog structures

(cherry picked from commit e39a90e11bfed2b4445c37db1532488aa9e3e725)
pv: proper length for line transformation when handling last line of value

(cherry picked from commit f1a09e44268c77641216a78878f2c73c6e5a4d66)
core: free previous allocated variable if no more pkg to build rve struct

- cleaner shut down if not enough memory at startup

(cherry picked from commit ace56c6bd2221920b965185c1c9a5997cd3f2768)
db_flatstore: free result before returning null on no more pkg

- partial allocation when doing an incomplete new connection

(cherry picked from commit 74743d6ef3bf74c1226ba5a1b6bebfbe19b06b93)
ipops: free dns pv structure on invalid pv name

(cherry picked from commit e53c715c74fb5b58f4f68b81acb60de66b19b8cc)
rls: proper header define guard and check of null returned value

(cherry picked from commit 4f2da3e025fa281f88e80bb841a51d6546219ae8)
kamcmd: proper size for memset, based on malloc

(cherry picked from commit 7134959725011baa504a027c4561e0054dd907ae)
topoh: match on all ports if none is in the uri for checking self

- forcing default 5060 can fail for multi-listen case and tls

(cherry picked from commit 1d90f4de94dfc887cc6129624fd5e6ad989abd37)
core: use port 5061 for checking self when uri has transport tls

- 5060 was used, failing to match myself condition

(cherry picked from commit 2e55d7bd218c9f954da7d289ec1be090bb4d88b0)
core: print number of parameters used for searching cfg function

(cherry picked from commit a313a8d33afdee6c7eb70cd57161aef8e70c5bcf)
modules/siputils:  generate error message if parsing of is_gruu() uri fails

(cherry picked from commit 365a60772de9c1d2f19ecf52b12f6d75b348e996)
core: allow listening on tls without listening on tcp

- reported in FS#425

(cherry picked from commit eea7f9d04090a736c8a0f2b2a350c08635cc8e39)
Core: Bugfix: Do not reset tcp_listeners: We may only listen on TCP.

(cherry picked from commit 9b9d15875aa09a5574ff0754309f4f77161d3194)
Fixed bug with JAVA_HOME detection.

(cherry picked from commit 5a05370f35bdeb7277b2f53f5c3e95fb672d4024)
Fixed misstypes and indents in docs.

(cherry picked from commit 5bede9a9a77ad01e06d849485d6ce4274eca3fd4)
pkg/rpm: use pkg memory size when checking config in init script

- for large configs, check can fail due to low memory

(cherry picked from commit 91a362e2f1bae90e2564491560aff8bad5b04564)