summaryrefslogtreecommitdiffstats
path: root/pcilib/pci.c
diff options
context:
space:
mode:
authorzilio nicolas <nicolas.zilio@kit.edu>2015-09-07 10:35:48 +0200
committerzilio nicolas <nicolas.zilio@kit.edu>2015-09-07 10:35:48 +0200
commitd996fab54c59ca0b34d4ff7c4ab5ab8247559db0 (patch)
tree5cd92a166f189980da166dcfe2122d89c7f82190 /pcilib/pci.c
parentea28e2990ae59e21856d9ae0311cec5b5415237b (diff)
downloadpcitool-d996fab54c59ca0b34d4ff7c4ab5ab8247559db0.tar.gz
pcitool-d996fab54c59ca0b34d4ff7c4ab5ab8247559db0.tar.bz2
pcitool-d996fab54c59ca0b34d4ff7c4ab5ab8247559db0.tar.xz
pcitool-d996fab54c59ca0b34d4ff7c4ab5ab8247559db0.zip
further modifications
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r--pcilib/pci.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c
index 8bbee2f..5f3c8aa 100644
--- a/pcilib/pci.c
+++ b/pcilib/pci.c
@@ -172,7 +172,12 @@ pcilib_t *pcilib_open(const char *device, const char *model) {
if (!ctx->model)
ctx->model = strdup(model?model:"pci");
- pcilib_init_xml(ctx, ctx->model);
+ err = pcilib_init_xml(ctx, ctx->model);
+ if (err) {
+ pcilib_error("Error (%i) initializing xml part\n", err);
+ pcilib_close(ctx);
+ return NULL;
+ }
ctx->model_info.registers = ctx->registers;
ctx->model_info.banks = ctx->banks;
@@ -357,6 +362,9 @@ void pcilib_close(pcilib_t *ctx) {
}
pcilib_free_register_banks(ctx);
+
+ if(ctx->xml_ctx)
+ pcilib_free_xml(ctx);
if (ctx->register_ctx)
free(ctx->register_ctx);