Skip to content

Commit

Permalink
fix potential null pointer dereference found by coverity (#187)
Browse files Browse the repository at this point in the history
CID 442478: (#undefined of undefined): Explicit null dereferenced (FORWARD_NULL)
6. var_deref_model: Passing null pointer app to SQLWriteFileDSN, which dereferences it.[show details]
119        ret = SQLWriteFileDSN( file, app, key, str );
  • Loading branch information
chipitsine authored Oct 7, 2024
1 parent 5fe9f74 commit 793d7c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odbcinst/SQLWriteFileDSN.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ BOOL INSTAPI SQLWriteFileDSNW(LPCWSTR lpszFileName,
key = lpszKeyName ? _single_string_alloc_and_copy( lpszKeyName ) : (char*)NULL;
str = lpszString ? _single_string_alloc_and_copy( lpszString ) : (char*)NULL;

ret = SQLWriteFileDSN( file, app, key, str );
ret = app ? SQLWriteFileDSN( file, app, key, str ) : FALSE;

if ( file )
free( file );
Expand Down

0 comments on commit 793d7c0

Please sign in to comment.