[Xenomai-git] Alexis Berlemont : analogy: fix bad error handling path in test programs

2009-12-25 Thread GIT version control
Module: xenomai-head
Branch: master
Commit: e305035eb6adc4220fe179477f3e300ad944f85c
URL:
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=e305035eb6adc4220fe179477f3e300ad944f85c

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Wed Nov 25 13:48:52 2009 +0100

analogy: fix bad error handling path in test programs

---

 src/utils/analogy/cmd_read.c   |5 +++--
 src/utils/analogy/cmd_write.c  |5 +++--
 src/utils/analogy/insn_read.c  |2 +-
 src/utils/analogy/insn_write.c |2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c
index f665ccd..99bdab8 100644
--- a/src/utils/analogy/cmd_read.c
+++ b/src/utils/analogy/cmd_read.c
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
unsigned int i, scan_size = 0, cnt = 0;
unsigned long buf_size;
void *map = NULL;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
 
/* Compute arguments */
while ((ret = getopt_long(argc,
@@ -411,7 +411,8 @@ out_main:
munmap(map, buf_size);
 
/* Free the buffer used as device descriptor */
-   free(dsc.sbdata);
+   if (dsc.sbdata != NULL)
+   free(dsc.sbdata);
 
/* Release the file descriptor */
a4l_close(dsc);
diff --git a/src/utils/analogy/cmd_write.c b/src/utils/analogy/cmd_write.c
index 05b648a..9fe536e 100644
--- a/src/utils/analogy/cmd_write.c
+++ b/src/utils/analogy/cmd_write.c
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
unsigned int i, scan_size = 0, cnt = 0;
unsigned long buf_size;
void *map = NULL;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
 
/* Compute arguments */
while ((ret = getopt_long(argc,
@@ -405,7 +405,8 @@ int main(int argc, char *argv[])
 out_main:
 
/* Free the buffer used as device descriptor */
-   free(dsc.sbdata);
+   if (dsc.sbdata != NULL)
+   free(dsc.sbdata);
 
/* Release the file descriptor */
a4l_close(dsc);
diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c
index f4029be..50f2c98 100644
--- a/src/utils/analogy/insn_read.c
+++ b/src/utils/analogy/insn_read.c
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 {
int ret = 0, i;
unsigned int cnt = 0;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 
diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c
index f5bda70..6da24da 100644
--- a/src/utils/analogy/insn_write.c
+++ b/src/utils/analogy/insn_write.c
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 {
int ret = 0;
unsigned int cnt = 0;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: fix bad error handling path in test programs

2009-12-09 Thread GIT version control
Module: xenomai-abe
Branch: analogy
Commit: f145ea98781b37356898b88cdcabd6610070073a
URL:
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=f145ea98781b37356898b88cdcabd6610070073a

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Wed Nov 25 13:48:52 2009 +0100

analogy: fix bad error handling path in test programs

---

 src/utils/analogy/cmd_read.c   |5 +++--
 src/utils/analogy/cmd_write.c  |5 +++--
 src/utils/analogy/insn_read.c  |2 +-
 src/utils/analogy/insn_write.c |2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c
index f665ccd..99bdab8 100644
--- a/src/utils/analogy/cmd_read.c
+++ b/src/utils/analogy/cmd_read.c
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
unsigned int i, scan_size = 0, cnt = 0;
unsigned long buf_size;
void *map = NULL;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
 
/* Compute arguments */
while ((ret = getopt_long(argc,
@@ -411,7 +411,8 @@ out_main:
munmap(map, buf_size);
 
/* Free the buffer used as device descriptor */
-   free(dsc.sbdata);
+   if (dsc.sbdata != NULL)
+   free(dsc.sbdata);
 
/* Release the file descriptor */
a4l_close(dsc);
diff --git a/src/utils/analogy/cmd_write.c b/src/utils/analogy/cmd_write.c
index 05b648a..9fe536e 100644
--- a/src/utils/analogy/cmd_write.c
+++ b/src/utils/analogy/cmd_write.c
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
unsigned int i, scan_size = 0, cnt = 0;
unsigned long buf_size;
void *map = NULL;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
 
/* Compute arguments */
while ((ret = getopt_long(argc,
@@ -405,7 +405,8 @@ int main(int argc, char *argv[])
 out_main:
 
/* Free the buffer used as device descriptor */
-   free(dsc.sbdata);
+   if (dsc.sbdata != NULL)
+   free(dsc.sbdata);
 
/* Release the file descriptor */
a4l_close(dsc);
diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c
index f4029be..50f2c98 100644
--- a/src/utils/analogy/insn_read.c
+++ b/src/utils/analogy/insn_read.c
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 {
int ret = 0, i;
unsigned int cnt = 0;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 
diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c
index f5bda70..6da24da 100644
--- a/src/utils/analogy/insn_write.c
+++ b/src/utils/analogy/insn_write.c
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 {
int ret = 0;
unsigned int cnt = 0;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: fix bad error handling path in test programs

2009-12-06 Thread GIT version control
Module: xenomai-abe
Branch: analogy
Commit: 7b161a2f983a0ba196377b3e71897ce86bb50b74
URL:
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=7b161a2f983a0ba196377b3e71897ce86bb50b74

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Wed Nov 25 13:48:52 2009 +0100

analogy: fix bad error handling path in test programs

---

 src/utils/analogy/cmd_read.c   |5 +++--
 src/utils/analogy/cmd_write.c  |5 +++--
 src/utils/analogy/insn_read.c  |2 +-
 src/utils/analogy/insn_write.c |2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c
index f665ccd..99bdab8 100644
--- a/src/utils/analogy/cmd_read.c
+++ b/src/utils/analogy/cmd_read.c
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
unsigned int i, scan_size = 0, cnt = 0;
unsigned long buf_size;
void *map = NULL;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
 
/* Compute arguments */
while ((ret = getopt_long(argc,
@@ -411,7 +411,8 @@ out_main:
munmap(map, buf_size);
 
/* Free the buffer used as device descriptor */
-   free(dsc.sbdata);
+   if (dsc.sbdata != NULL)
+   free(dsc.sbdata);
 
/* Release the file descriptor */
a4l_close(dsc);
diff --git a/src/utils/analogy/cmd_write.c b/src/utils/analogy/cmd_write.c
index 05b648a..9fe536e 100644
--- a/src/utils/analogy/cmd_write.c
+++ b/src/utils/analogy/cmd_write.c
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
unsigned int i, scan_size = 0, cnt = 0;
unsigned long buf_size;
void *map = NULL;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
 
/* Compute arguments */
while ((ret = getopt_long(argc,
@@ -405,7 +405,8 @@ int main(int argc, char *argv[])
 out_main:
 
/* Free the buffer used as device descriptor */
-   free(dsc.sbdata);
+   if (dsc.sbdata != NULL)
+   free(dsc.sbdata);
 
/* Release the file descriptor */
a4l_close(dsc);
diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c
index f4029be..50f2c98 100644
--- a/src/utils/analogy/insn_read.c
+++ b/src/utils/analogy/insn_read.c
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 {
int ret = 0, i;
unsigned int cnt = 0;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 
diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c
index f5bda70..6da24da 100644
--- a/src/utils/analogy/insn_write.c
+++ b/src/utils/analogy/insn_write.c
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 {
int ret = 0;
unsigned int cnt = 0;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: fix bad error handling path in test programs

2009-11-25 Thread GIT version control
Module: xenomai-abe
Branch: analogy
Commit: 8e554204b9f36aafcb89c72c13362a00c5a3fa7b
URL:
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=8e554204b9f36aafcb89c72c13362a00c5a3fa7b

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Wed Nov 25 13:48:52 2009 +0100

analogy: fix bad error handling path in test programs

---

 src/utils/analogy/cmd_read.c   |5 +++--
 src/utils/analogy/cmd_write.c  |5 +++--
 src/utils/analogy/insn_read.c  |2 +-
 src/utils/analogy/insn_write.c |2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c
index f665ccd..99bdab8 100644
--- a/src/utils/analogy/cmd_read.c
+++ b/src/utils/analogy/cmd_read.c
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
unsigned int i, scan_size = 0, cnt = 0;
unsigned long buf_size;
void *map = NULL;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
 
/* Compute arguments */
while ((ret = getopt_long(argc,
@@ -411,7 +411,8 @@ out_main:
munmap(map, buf_size);
 
/* Free the buffer used as device descriptor */
-   free(dsc.sbdata);
+   if (dsc.sbdata != NULL)
+   free(dsc.sbdata);
 
/* Release the file descriptor */
a4l_close(dsc);
diff --git a/src/utils/analogy/cmd_write.c b/src/utils/analogy/cmd_write.c
index 05b648a..9fe536e 100644
--- a/src/utils/analogy/cmd_write.c
+++ b/src/utils/analogy/cmd_write.c
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
unsigned int i, scan_size = 0, cnt = 0;
unsigned long buf_size;
void *map = NULL;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
 
/* Compute arguments */
while ((ret = getopt_long(argc,
@@ -405,7 +405,8 @@ int main(int argc, char *argv[])
 out_main:
 
/* Free the buffer used as device descriptor */
-   free(dsc.sbdata);
+   if (dsc.sbdata != NULL)
+   free(dsc.sbdata);
 
/* Release the file descriptor */
a4l_close(dsc);
diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c
index f4029be..50f2c98 100644
--- a/src/utils/analogy/insn_read.c
+++ b/src/utils/analogy/insn_read.c
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 {
int ret = 0, i;
unsigned int cnt = 0;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 
diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c
index f5bda70..6da24da 100644
--- a/src/utils/analogy/insn_write.c
+++ b/src/utils/analogy/insn_write.c
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 {
int ret = 0;
unsigned int cnt = 0;
-   a4l_desc_t dsc;
+   a4l_desc_t dsc = { .sbdata = NULL };
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git