Do not try to free the static ra_filter (#105)
Fixes: https://github.com/espressif/esp-who/issues/101pull/104/head
parent
49ecd1a2b6
commit
447b873ad8
|
@ -47,14 +47,6 @@ static const char* TAG = "camera_httpd";
|
||||||
#define FACE_COLOR_PURPLE (FACE_COLOR_BLUE | FACE_COLOR_RED)
|
#define FACE_COLOR_PURPLE (FACE_COLOR_BLUE | FACE_COLOR_RED)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
size_t size; //number of values used for filtering
|
|
||||||
size_t index; //current value index
|
|
||||||
size_t count; //value count
|
|
||||||
int sum;
|
|
||||||
int * values; //array to be filled with values
|
|
||||||
} ra_filter_t;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
httpd_req_t *req;
|
httpd_req_t *req;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
@ -65,7 +57,6 @@ static const char* _STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary="
|
||||||
static const char* _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n";
|
static const char* _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n";
|
||||||
static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n";
|
static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n";
|
||||||
|
|
||||||
static ra_filter_t ra_filter;
|
|
||||||
httpd_handle_t stream_httpd = NULL;
|
httpd_handle_t stream_httpd = NULL;
|
||||||
httpd_handle_t camera_httpd = NULL;
|
httpd_handle_t camera_httpd = NULL;
|
||||||
#if CONFIG_ESP_FACE_DETECT_ENABLED
|
#if CONFIG_ESP_FACE_DETECT_ENABLED
|
||||||
|
@ -77,6 +68,15 @@ static int8_t is_enrolling = 0;
|
||||||
static face_id_list id_list = {0};
|
static face_id_list id_list = {0};
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
size_t size; //number of values used for filtering
|
||||||
|
size_t index; //current value index
|
||||||
|
size_t count; //value count
|
||||||
|
int sum;
|
||||||
|
int * values; //array to be filled with values
|
||||||
|
} ra_filter_t;
|
||||||
|
|
||||||
static ra_filter_t ra_filter;
|
static ra_filter_t ra_filter;
|
||||||
|
|
||||||
static ra_filter_t * ra_filter_init(ra_filter_t * filter, size_t sample_size){
|
static ra_filter_t * ra_filter_init(ra_filter_t * filter, size_t sample_size){
|
||||||
|
@ -84,7 +84,6 @@ static ra_filter_t * ra_filter_init(ra_filter_t * filter, size_t sample_size){
|
||||||
|
|
||||||
filter->values = (int *)malloc(sample_size * sizeof(int));
|
filter->values = (int *)malloc(sample_size * sizeof(int));
|
||||||
if(!filter->values){
|
if(!filter->values){
|
||||||
free(filter);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset(filter->values, 0, sample_size * sizeof(int));
|
memset(filter->values, 0, sample_size * sizeof(int));
|
||||||
|
|
Loading…
Reference in New Issue