domain_conf.c: avoid a leak and the need for "cleanup:" block
* src/conf/domain_conf.c (virDomainChrDefFormat): Plug a leak on an error path, and at the same time, eliminate the need for a "cleanup:" block. Before, the "return -1" after the switch would leak an "addr" string. Now, by reversing the port,addr- getting blocks we can free "addr" immediately and skip the goto.
Showing
想要评论请 注册 或 登录