Skip to content

Commit b3918bf

Browse files
committed
Coverity fixes to tools.
1 parent 0ac8153 commit b3918bf

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

tools/cups-oauth.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ do_get_user_id(
411411
cups_json_t *claims; // Claims
412412
char *json, // JSON string
413413
date[256]; // Date
414+
int ret = 0; // Exit status
414415

415416

416417
// Get the user_id...
@@ -463,12 +464,10 @@ do_get_user_id(
463464
}
464465
break;
465466
}
466-
467-
return (0);
468467
}
469468
else
470469
{
471-
return (1);
470+
ret = 1;
472471
}
473472
}
474473
else if ((json = cupsJSONExportString(claims)) != NULL)
@@ -477,7 +476,9 @@ do_get_user_id(
477476
free(json);
478477
}
479478

480-
return (0);
479+
cupsJWTDelete(user_id);
480+
481+
return (ret);
481482
}
482483

483484

tools/cups-x509.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ do_ca(const char *common_name, // I - Common name
440440
{
441441
cupsLangPrintf(stderr, _("cups-x509: Unable to read '%s'."), csrfile);
442442
close(csrfd);
443+
free(request);
443444
return (1);
444445
}
445446

0 commit comments

Comments
 (0)