#12 fixed memory leak. Enabled -O3 flag

This commit is contained in:
2017-09-18 21:38:51 +02:00
parent ca8b02acbc
commit ccc5b07ddf
2 changed files with 3 additions and 1 deletions

View File

@@ -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;
} }

View File

@@ -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