Message ID | 20220304013643.1054605-1-alison.schofield@intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 7564aeeae7bc8c3813bd80676769bd11a1055ca0 |
Headers | show |
Series | [ndctl] cxl/list: always free the path var in add_cxl_decoder() | expand |
diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c index daa2bbc5a299..aad7559daba2 100644 --- a/cxl/lib/libcxl.c +++ b/cxl/lib/libcxl.c @@ -1018,11 +1018,13 @@ static void *add_cxl_decoder(void *parent, int id, const char *cxldecoder_base) cxl_decoder_foreach(port, decoder_dup) if (decoder_dup->id == decoder->id) { free_decoder(decoder, NULL); + free(path); return decoder_dup; } list_add(&port->decoders, &decoder->list); + free(path); return decoder; err: free(decoder->dev_path);