summaryrefslogtreecommitdiffstats
path: root/src/uca.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/uca.c')
-rw-r--r--src/uca.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/uca.c b/src/uca.c
index 3549e60..af934c8 100644
--- a/src/uca.c
+++ b/src/uca.c
@@ -33,7 +33,7 @@ struct uca_t *uca_init()
int i = 0;
while (inits[i] != NULL) {
uca_cam_init init = inits[i];
- if (init(uca))
+ if (init(uca) != UCA_ERR_INIT_NOT_FOUND)
return uca;
i++;
}
@@ -45,6 +45,8 @@ struct uca_t *uca_init()
void uca_destroy(struct uca_t *uca)
{
- uca->cam_destroy(uca);
- free(uca);
+ if (uca != NULL) {
+ uca->cam_destroy(uca);
+ free(uca);
+ }
}