Skip to content

Commit

Permalink
fix potential null pointer dereference found by coverity (#186)
Browse files Browse the repository at this point in the history
CID 442459: (#2 of 2): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking conn->functions suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
3048        if ( conn -> functions )
3049        {
3050            free( conn -> functions );
3051            conn -> functions = NULL;
3052        }
  • Loading branch information
chipitsine authored Oct 7, 2024
1 parent 793d7c0 commit 215030a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DriverManager/drivermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ int add_to_pool( DMHDBC connection, CPOOLHEAD *pooh );
(stmt,pn,dtp,psp,ddp,np)

#define DM_SQLDISCONNECT 21
#define CHECK_SQLDISCONNECT(con) (con->functions[21].func!=NULL)
#define CHECK_SQLDISCONNECT(con) (con->functions!=NULL && con->functions[21].func!=NULL)
#define SQLDISCONNECT(con,dbc)\
((SQLRETURN (*)(SQLHDBC))\
con->functions[21].func)(dbc)
Expand Down

0 comments on commit 215030a

Please sign in to comment.