Some minor paranoia to appease valgrind.
This commit is contained in:
parent
439f07162e
commit
88d8e60511
@ -234,6 +234,7 @@ static JSValue _file_read_file(JSContext* context, JSValueConst this_val, int ar
|
|||||||
},
|
},
|
||||||
.size = k_file_read_max,
|
.size = k_file_read_max,
|
||||||
};
|
};
|
||||||
|
memset(req + 1, 0, k_file_read_max);
|
||||||
int result = uv_fs_open(tf_task_get_loop(task), &req->fs, file_name, UV_FS_O_RDONLY, 0, _file_read_open_callback);
|
int result = uv_fs_open(tf_task_get_loop(task), &req->fs, file_name, UV_FS_O_RDONLY, 0, _file_read_open_callback);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
{
|
{
|
||||||
|
@ -30,8 +30,7 @@ static int64_t _get_global_setting_int64(tf_ssb_t* ssb, const char* name, int64_
|
|||||||
{
|
{
|
||||||
if (sqlite3_bind_text(statement, 1, name, -1, NULL) == SQLITE_OK)
|
if (sqlite3_bind_text(statement, 1, name, -1, NULL) == SQLITE_OK)
|
||||||
{
|
{
|
||||||
if (sqlite3_step(statement) == SQLITE_ROW &&
|
if (sqlite3_step(statement) == SQLITE_ROW && sqlite3_column_type(statement, 0) != SQLITE_NULL)
|
||||||
sqlite3_column_type(statement, 0) != SQLITE_NULL)
|
|
||||||
{
|
{
|
||||||
result = sqlite3_column_int64(statement, 0);
|
result = sqlite3_column_int64(statement, 0);
|
||||||
}
|
}
|
||||||
|
@ -46,10 +46,10 @@ static JSValue _util_utf8_decode(JSContext* context, JSValueConst this_val, int
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t offset;
|
size_t offset = 0;
|
||||||
size_t element_size;
|
size_t element_size = 0;
|
||||||
JSValue buffer = tf_util_try_get_typed_array_buffer(context, argv[0], &offset, &length, &element_size);
|
JSValue buffer = tf_util_try_get_typed_array_buffer(context, argv[0], &offset, &length, &element_size);
|
||||||
size_t size;
|
size_t size = 0;
|
||||||
if (!JS_IsException(buffer))
|
if (!JS_IsException(buffer))
|
||||||
{
|
{
|
||||||
array = tf_util_try_get_array_buffer(context, &size, buffer);
|
array = tf_util_try_get_array_buffer(context, &size, buffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user