diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-10-26 17:11:44 -0400 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-10-26 19:17:53 -0700 |
commit | d3d51b175dd39722e58b7315009a5fff1b000260 (patch) | |
tree | ae0374e615829ee8a99112d6a9e0a0b4b24c219c /core/import-divinglog.c | |
parent | cc2269b9c5236b60b6a9c86588285f0a78836b77 (diff) | |
download | subsurface-d3d51b175dd39722e58b7315009a5fff1b000260.tar.gz |
Cleanup: pass NULL pointer for error string pointer
Since we never did anything with the error string, why even ask for it.
And this way we don't have to deal with the memory returned, either.
Found by Coverity. Fixes CIDs 350124, 350113, 350106, 350099, 350091
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/import-divinglog.c')
-rw-r--r-- | core/import-divinglog.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/import-divinglog.c b/core/import-divinglog.c index d29770080..98d2effbb 100644 --- a/core/import-divinglog.c +++ b/core/import-divinglog.c @@ -274,7 +274,6 @@ static int divinglog_dive(void *param, int columns, char **data, char **column) int retval = 0, diveid; struct parser_state *state = (struct parser_state *)param; sqlite3 *handle = state->sql_handle; - char *err = NULL; char get_profile_template[] = "select ProfileInt,Profile,Profile2,Profile3,Profile4,Profile5 from Logbook where ID = %d"; char get_cylinder0_template[] = "select 0,TankSize,PresS,PresE,PresW,O2,He,DblTank from Logbook where ID = %d"; char get_cylinder_template[] = "select TankID,TankSize,PresS,PresE,PresW,O2,He,DblTank from Tank where LogID = %d order by TankID"; @@ -347,14 +346,14 @@ static int divinglog_dive(void *param, int columns, char **data, char **column) } snprintf(get_buffer, sizeof(get_buffer) - 1, get_cylinder0_template, diveid); - retval = sqlite3_exec(handle, get_buffer, &divinglog_cylinder, state, &err); + retval = sqlite3_exec(handle, get_buffer, &divinglog_cylinder, state, NULL); if (retval != SQLITE_OK) { fprintf(stderr, "%s", "Database query divinglog_cylinder0 failed.\n"); return 1; } snprintf(get_buffer, sizeof(get_buffer) - 1, get_cylinder_template, diveid); - retval = sqlite3_exec(handle, get_buffer, &divinglog_cylinder, state, &err); + retval = sqlite3_exec(handle, get_buffer, &divinglog_cylinder, state, NULL); if (retval != SQLITE_OK) { fprintf(stderr, "%s", "Database query divinglog_cylinder failed.\n"); return 1; @@ -384,7 +383,7 @@ static int divinglog_dive(void *param, int columns, char **data, char **column) } snprintf(get_buffer, sizeof(get_buffer) - 1, get_profile_template, diveid); - retval = sqlite3_exec(handle, get_buffer, &divinglog_profile, state, &err); + retval = sqlite3_exec(handle, get_buffer, &divinglog_profile, state, NULL); if (retval != SQLITE_OK) { fprintf(stderr, "%s", "Database query divinglog_profile failed.\n"); return 1; @@ -403,7 +402,6 @@ int parse_divinglog_buffer(sqlite3 *handle, const char *url, const char *buffer, UNUSED(size); int retval; - char *err = NULL; struct parser_state state; init_parser_state(&state); @@ -414,7 +412,7 @@ int parse_divinglog_buffer(sqlite3 *handle, const char *url, const char *buffer, char get_dives[] = "select Number,strftime('%s',Divedate || ' ' || ifnull(Entrytime,'00:00')),Country || ' - ' || City || ' - ' || Place,Buddy,Comments,Depth,Divetime,Divemaster,Airtemp,Watertemp,Weight,Divesuit,Computer,ID,Visibility,SupplyType from Logbook where UUID not in (select UUID from DeletedRecords)"; - retval = sqlite3_exec(handle, get_dives, &divinglog_dive, &state, &err); + retval = sqlite3_exec(handle, get_dives, &divinglog_dive, &state, NULL); free_parser_state(&state); if (retval != SQLITE_OK) { |