Skip to content

Commit edf8502

Browse files
Mikhail GalaninTotktonada
Mikhail Galanin
authored andcommitted
Fix freeing the unitialised variable
Even though, we initialise "space_string" with NULL, we goto schema_space_value_free() before this statement.
1 parent e0152fd commit edf8502

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tarantool_schema.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ schema_add_space(
464464
) {
465465
const char *tuple = *data;
466466
if (mp_typeof(*tuple) != MP_ARRAY)
467-
goto error;
467+
goto error_return;
468468
uint32_t tuple_len = mp_decode_array(&tuple);
469469
if (tuple_len < 6)
470-
goto error;
470+
goto error_return;
471471
struct schema_space_value *space_number = NULL, *space_string = NULL;
472472
space_string = pemalloc(sizeof(struct schema_space_value), 1);
473473
if (space_string == NULL)
@@ -548,6 +548,7 @@ schema_add_space(
548548
return 0;
549549
error:
550550
schema_space_value_free(space_string);
551+
error_return:
551552
return -1;
552553
}
553554

0 commit comments

Comments
 (0)