depmod: output_builtin_alias_bin: free idx on error path
authorYauheni Kaliuta <yauheni.kaliuta@redhat.com>
Sun, 29 Nov 2020 16:47:36 +0000 (18:47 +0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 1 Dec 2020 08:44:17 +0000 (00:44 -0800)
commitbd96d05256db2ff9a89dbe2e8bb6e26fcb800052
tree82e7ab0aea70f8c9298115925b147f52f6043f5c
parent47807c4cfa5ffe1e5da27e3d3056d9b47ba998c5
depmod: output_builtin_alias_bin: free idx on error path

idx is allocated in the beginning but it's not freed if there is
a failure after the allocation.

Change the error path: return immediately if idx allocation fails
and then free it in both success and error path at the end.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
tools/depmod.c