* According to strdup(3) manual strdup() allocates memory with malloc(3)
and that memory should be released with free(3) when no longer needed.
* For non existent path or file open error mkversion used exit() with no
prior free() for allocated memory.
* This change introduces ret variable, exit label, and free on exit in order
to avoid potential memory leak.
* tools/mkversion is a tiny short-lived utility and the memory gets freed
by the OS upon application termination so that was not a bit issue, but now
memory leak scanners should be happy as we have free() in pair to strdup().
Reported-by: xjDeng.
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>