mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 05:31:44 +00:00
Merge pull request #430 from xrmx/coverity2510
Fix some leaks reported by coverity
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -364,6 +364,7 @@ static char *uwsgi_scheme_data(char *url, size_t *size, int add_zero) {
|
||||
}
|
||||
}
|
||||
}
|
||||
close(fd);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
@@ -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) {
|
||||
|
||||
@@ -104,8 +104,8 @@ static void rrdtool_post_init() {
|
||||
exit(1);
|
||||
}
|
||||
created++;
|
||||
free(filename);
|
||||
}
|
||||
free(filename);
|
||||
um = um->next;
|
||||
}
|
||||
uwsgi_rwunlock(uwsgi.metrics_lock);
|
||||
|
||||
Reference in New Issue
Block a user