Merge pull request #430 from xrmx/coverity2510

Fix some leaks reported by coverity
This commit is contained in:
unbit
2013-10-25 19:14:19 -07:00
5 changed files with 10 additions and 3 deletions
+1
View File
@@ -38,6 +38,7 @@ void uwsgi_fsmon_setup() {
char *space = strchr(copy, ' ');
if (!space) {
uwsgi_log("[uwsgi-fsmon] invalid syntax: \"%s\"\n", usl->value);
free(copy);
goto next;
}
*space = 0;
+1
View File
@@ -364,6 +364,7 @@ static char *uwsgi_scheme_data(char *url, size_t *size, int add_zero) {
}
}
}
close(fd);
return buffer;
}
+1 -1
View File
@@ -305,6 +305,7 @@ static uint8_t snmp_int_to_snmp(uint64_t snmp_val, uint8_t oid_type, uint8_t * b
uint8_t tlen;
int i, j;
uint8_t *ptr = (uint8_t *) & snmp_val;
int32_t val32 = (int32_t) snmp_val;
// check for counter, counter64 or gauge
@@ -316,7 +317,6 @@ static uint8_t snmp_int_to_snmp(uint64_t snmp_val, uint8_t oid_type, uint8_t * b
}
else {
tlen = 4;
int32_t val32 = (int32_t) snmp_val;
ptr = (uint8_t *) &val32;
}
+6 -1
View File
@@ -3419,7 +3419,11 @@ int uwsgi_write_intfile(char *filename, int n) {
uwsgi_error_open(filename);
exit(1);
}
if (fprintf(pidfile, "%d\n", n) <= 0 || ferror(pidfile) || fclose(pidfile)) {
if (fprintf(pidfile, "%d\n", n) <= 0 || ferror(pidfile)) {
fclose(pidfile);
return -1;
}
if (fclose(pidfile)) {
return -1;
}
return 0;
@@ -4228,6 +4232,7 @@ void uwsgi_envdir(char *edir) {
free(content);
}
closedir(d);
}
void uwsgi_envdirs(struct uwsgi_string_list *envdirs) {
+1 -1
View File
@@ -104,8 +104,8 @@ static void rrdtool_post_init() {
exit(1);
}
created++;
free(filename);
}
free(filename);
um = um->next;
}
uwsgi_rwunlock(uwsgi.metrics_lock);