projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ea9088
)
src/utils_rrdcreate.c: Free allocated memory in all error handling cases.
author
Florian Forster
<octo@collectd.org>
Sat, 23 Feb 2013 12:13:40 +0000
(13:13 +0100)
committer
Florian Forster
<octo@collectd.org>
Sat, 23 Feb 2013 12:13:40 +0000
(13:13 +0100)
src/utils_rrdcreate.c
patch
|
blob
|
history
diff --git
a/src/utils_rrdcreate.c
b/src/utils_rrdcreate.c
index
2228660
..
33493bf
100644
(file)
--- a/
src/utils_rrdcreate.c
+++ b/
src/utils_rrdcreate.c
@@
-472,11
+472,18
@@
static int srrd_create_async (const char *filename,
status = pthread_attr_init (&attr);
if (status != 0)
status = pthread_attr_init (&attr);
if (status != 0)
+ {
+ srrd_create_args_destroy (args);
return (-1);
return (-1);
+ }
status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (status != 0)
status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (status != 0)
+ {
+ pthread_attr_destroy (&attr);
+ srrd_create_args_destroy (args);
return (-1);
return (-1);
+ }
status = pthread_create (&thread, &attr, srrd_create_thread, args);
if (status != 0)
status = pthread_create (&thread, &attr, srrd_create_thread, args);
if (status != 0)
@@
-490,6
+497,7
@@
static int srrd_create_async (const char *filename,
}
pthread_attr_destroy (&attr);
}
pthread_attr_destroy (&attr);
+ /* args is freed in srrd_create_thread(). */
return (0);
}
return (0);
}