#12 fixed memory leak. Enabled -O3 flag
This commit is contained in:
@@ -108,6 +108,7 @@ int callback_absTempHum(const struct _u_request *request, struct _u_response *re
|
|||||||
insertData(1, temphum[0], temphum[1], 0);
|
insertData(1, temphum[0], temphum[1], 0);
|
||||||
|
|
||||||
ulfius_set_string_body_response(response, 200, response_body);
|
ulfius_set_string_body_response(response, 200, response_body);
|
||||||
|
free(response_body);
|
||||||
//o_free(url_params);
|
//o_free(url_params);
|
||||||
return U_CALLBACK_CONTINUE;
|
return U_CALLBACK_CONTINUE;
|
||||||
}
|
}
|
||||||
@@ -125,6 +126,7 @@ int callback_calcAbsTempHum(const struct _u_request *request, struct _u_response
|
|||||||
char *response_body = msprintf("%f", absoluteHumidityFloat(temphum[0], temphum[1]));
|
char *response_body = msprintf("%f", absoluteHumidityFloat(temphum[0], temphum[1]));
|
||||||
|
|
||||||
ulfius_set_string_body_response(response, 200, response_body);
|
ulfius_set_string_body_response(response, 200, response_body);
|
||||||
|
free(response_body);
|
||||||
//o_free(url_params);
|
//o_free(url_params);
|
||||||
return U_CALLBACK_CONTINUE;
|
return U_CALLBACK_CONTINUE;
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
VERSION = 1.0
|
VERSION = 1.0
|
||||||
CC = cc
|
CC = cc
|
||||||
CFLAGS = -Wall -g -D_GNU_SOURCE -D_REENTRANT -DVERSION=\"$(VERSION)\" `mysql_config --cflags`
|
CFLAGS = -Wall -O3 -D_GNU_SOURCE -D_REENTRANT -DVERSION=\"$(VERSION)\" `mysql_config --cflags`
|
||||||
#LDFLAGS = -lm -lpthread `gtk-config --cflags` `gtk-config --libs` -lgthread
|
#LDFLAGS = -lm -lpthread `gtk-config --cflags` `gtk-config --libs` -lgthread
|
||||||
LDFLAGS = `mysql_config --libs` -lm -lulfius -lyder -lorcania
|
LDFLAGS = `mysql_config --libs` -lm -lulfius -lyder -lorcania
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user