Skip to content

Commit d777133

Browse files
committed
Coverity fixes to new tools.
1 parent d7088f5 commit d777133

5 files changed

Lines changed: 9 additions & 552 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
/cups/testarray
5656
/cups/testcache
5757
/cups/testclient
58+
/cups/testclock
5859
/cups/testconflicts
5960
/cups/testcreds
6061
/cups/testcups

tools/cups-oauth.c

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

414415

415416
// Get the user_id...
@@ -462,12 +463,10 @@ do_get_user_id(
462463
}
463464
break;
464465
}
465-
466-
return (0);
467466
}
468467
else
469468
{
470-
return (1);
469+
ret = 1;
471470
}
472471
}
473472
else if ((json = cupsJSONExportString(claims)) != NULL)
@@ -476,7 +475,9 @@ do_get_user_id(
476475
free(json);
477476
}
478477

479-
return (0);
478+
cupsJWTDelete(user_id);
479+
480+
return (ret);
480481
}
481482

482483

tools/cups-x509.c

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

xcode/CUPS.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3622,8 +3622,8 @@
36223622
27A0347B1A8BDB1300650675 /* lpadmin */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = lpadmin; sourceTree = BUILT_PRODUCTS_DIR; };
36233623
27C3E95B2DB04AC500A6ABBF /* cups-x509 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "cups-x509"; sourceTree = BUILT_PRODUCTS_DIR; };
36243624
27C3E9672DB04ACE00A6ABBF /* cups-oauth */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "cups-oauth"; sourceTree = BUILT_PRODUCTS_DIR; };
3625-
27C3E9682DB04AFB00A6ABBF /* cups-oauth.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "cups-oauth.c"; sourceTree = "<group>"; };
3626-
27C3E9692DB04AFB00A6ABBF /* cups-x509.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "cups-x509.c"; sourceTree = "<group>"; };
3625+
27C3E9682DB04AFB00A6ABBF /* cups-oauth.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "cups-oauth.c"; path = "../tools/cups-oauth.c"; sourceTree = SOURCE_ROOT; };
3626+
27C3E9692DB04AFB00A6ABBF /* cups-x509.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "cups-x509.c"; path = "../tools/cups-x509.c"; sourceTree = SOURCE_ROOT; };
36273627
27C89C902613E7C300A58F43 /* cups-tls.m4 */ = {isa = PBXFileReference; lastKnownFileType = text; name = "cups-tls.m4"; path = "../config-scripts/cups-tls.m4"; sourceTree = "<group>"; };
36283628
27D3037D134148CB00F022B1 /* libcups2.def */ = {isa = PBXFileReference; lastKnownFileType = text; name = libcups2.def; path = ../cups/libcups2.def; sourceTree = "<group>"; };
36293629
27F515432AAFBECF0045EE21 /* raster-testpage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "raster-testpage.h"; path = "../cups/raster-testpage.h"; sourceTree = "<group>"; };

0 commit comments

Comments
 (0)