Core: fixed resource leak if binary upgrade fails due to no memory.
Core: fixed resource leak if binary upgrade fails due to no memory.

Found by Coverity (CID 992320).

firebase/nginx,firebase/nginx,hy0kl/nginx,firebase/nginx,firebase/nginx,hy0kl/nginx,hy0kl/nginx