Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
8fd64b9e
Commit
8fd64b9e
authored
Apr 14, 2019
by
Uwe Schulzweida
Browse files
Fix scan-build warning: Access to field 'ncvarid' results in a dereference of a null pointer.
parent
cc73bd65
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/basetime.c
View file @
8fd64b9e
...
...
@@ -6,15 +6,17 @@
void
basetimeInit
(
basetime_t
*
basetime
)
{
if
(
basetime
==
NULL
)
Error
(
"Internal problem! Basetime not allocated."
);
if
(
basetime
==
NULL
)
Error
(
"Internal problem! Basetime not allocated."
);
basetime
->
ncvarid
=
CDI_UNDEFID
;
basetime
->
ncdimid
=
CDI_UNDEFID
;
basetime
->
ncvarboundsid
=
CDI_UNDEFID
;
basetime
->
leadtimeid
=
CDI_UNDEFID
;
basetime
->
lwrf
=
false
;
basetime
->
timevar_cache
=
NULL
;
if
(
basetime
)
{
basetime
->
ncvarid
=
CDI_UNDEFID
;
basetime
->
ncdimid
=
CDI_UNDEFID
;
basetime
->
ncvarboundsid
=
CDI_UNDEFID
;
basetime
->
leadtimeid
=
CDI_UNDEFID
;
basetime
->
lwrf
=
false
;
basetime
->
timevar_cache
=
NULL
;
}
}
/*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment