intel: aubinator: Fix resource leak in gen_spec_load_from_path
authorGwan-gyeong Mun <elongbug@gmail.com>
Sun, 20 Nov 2016 07:07:19 +0000 (16:07 +0900)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 21 Nov 2016 14:38:11 +0000 (14:38 +0000)
This fixes resource leak in gen_spec_load_from_path XML_ParserCreate
failure path

CID 1373564

Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/tools/decoder.c

index 6bd02bf9053ea5465901473fbfb2984ebfdcef78..633251a44cf382bc2cb572d5f6c54e0ec7f07e38 100644 (file)
@@ -539,6 +539,7 @@ gen_spec_load_from_path(const struct gen_device_info *devinfo,
    XML_SetUserData(ctx.parser, &ctx);
    if (ctx.parser == NULL) {
       fprintf(stderr, "failed to create parser\n");
+      fclose(input);
       free(filename);
       return NULL;
    }