Skip to content

Commit

Permalink
fix: Two issues uncovered by GCC analyzer (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem authored Jun 3, 2020
1 parent b48c21d commit 5020ff5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/sentry_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ tokens_to_value(jsmntok_t *tokens, size_t token_count, const char *buf,
jsmntok_t *root = POP();
sentry_value_t rv = sentry_value_new_null();

if (!root) {
goto error;
}

switch (root->type) {
case JSMN_PRIMITIVE: {
switch (buf[root->start]) {
Expand Down
4 changes: 3 additions & 1 deletion src/sentry_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ sentry__bgworker_foreach_matching(sentry_bgworker_t *bgw,
bgw->task_count--;
dropped++;
} else {
prev_task->next_task = task;
if (prev_task) {
prev_task->next_task = task;
}
prev_task = task;
}

Expand Down

0 comments on commit 5020ff5

Please sign in to comment.