net/softnic: fix memory leak

Fix memory resource free for buffer allocation failure at pipeline
library build.

Coverity issue: 380975, 380977
Fixes: 0227003369 ("net/softnic: add pipeline library build command")

Signed-off-by: Harshad Narayane <harshad.suresh.narayane@intel.com>
Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
Harshad Narayane 2022-09-27 00:42:30 -04:00 committed by Ferruh Yigit
parent 204daeea01
commit 167756c117

View File

@ -326,7 +326,7 @@ cmd_softnic_pipeline_libbuild(struct pmd_internals *softnic __rte_unused,
buffer = malloc(MAX_LINE_SIZE);
if (!buffer) {
snprintf(out, out_size, MSG_OUT_OF_MEMORY);
return;
goto free;
}
snprintf(buffer,