summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-fcd/lib/fcd/fcd.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/gr-fcd/lib/fcd/fcd.c b/gr-fcd/lib/fcd/fcd.c
index 011d77be96..693f5fb81c 100644
--- a/gr-fcd/lib/fcd/fcd.c
+++ b/gr-fcd/lib/fcd/fcd.c
@@ -62,24 +62,15 @@ static hid_device *fcdOpen(void)
}
pszPath=strdup(phdi->path);
- if (pszPath==NULL)
- {
- return NULL;
- }
-
- hid_free_enumeration(phdi);
- phdi=NULL;
+ if(pszPath != NULL) {
+ phd = hid_open_path(pszPath);
- if ((phd=hid_open_path(pszPath)) == NULL)
- {
free(pszPath);
- pszPath=NULL;
-
- return NULL;
+ } else {
+ phd = NULL;
}
- free(pszPath);
- pszPath=NULL;
+ hid_free_enumeration(phdi);
return phd;
}