Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
5ae93b17
Commit
5ae93b17
authored
3 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
institutInq(): allocate ip_ref on the stack.
parent
3d2fc809
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#9516
failed
3 years ago
Stage: external
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/institution.c
+11
-13
11 additions, 13 deletions
src/institution.c
with
11 additions
and
13 deletions
src/institution.c
+
11
−
13
View file @
5ae93b17
...
...
@@ -125,8 +125,8 @@ struct instLoc
static
enum
cdiApplyRet
findInstitute
(
int
id
,
void
*
res
,
void
*
data
)
{
institute_t
*
ip1
=
((
struct
instLoc
*
)
data
)
->
ip
;
institute_t
*
ip2
=
(
institute_t
*
)
res
;
institute_t
*
ip1
=
((
struct
instLoc
*
)
data
)
->
ip
;
institute_t
*
ip2
=
(
institute_t
*
)
res
;
if
(
ip2
->
used
&&
!
instituteCompareKernel
(
ip1
,
ip2
))
{
((
struct
instLoc
*
)
data
)
->
id
=
id
;
...
...
@@ -139,19 +139,17 @@ findInstitute(int id, void *res, void *data)
int
institutInq
(
int
center
,
int
subcenter
,
const
char
*
name
,
const
char
*
longname
)
{
institute_t
*
ip_ref
=
(
institute_t
*
)
Malloc
(
sizeof
(
*
ip_ref
))
;
ip_ref
->
self
=
CDI_UNDEFID
;
ip_ref
->
used
=
0
;
ip_ref
->
center
=
center
;
ip_ref
->
subcenter
=
subcenter
;
ip_ref
->
name
=
name
&&
name
[
0
]
?
(
char
*
)
name
:
NULL
;
ip_ref
->
longname
=
longname
&&
longname
[
0
]
?
(
char
*
)
longname
:
NULL
;
struct
instLoc
state
=
{
.
ip
=
ip_ref
,
.
id
=
CDI_UNDEFID
};
institute_t
ip_ref
;
ip_ref
.
self
=
CDI_UNDEFID
;
ip_ref
.
used
=
0
;
ip_ref
.
center
=
center
;
ip_ref
.
subcenter
=
subcenter
;
ip_ref
.
name
=
(
name
&&
name
[
0
]
)
?
(
char
*
)
name
:
NULL
;
ip_ref
.
longname
=
(
longname
&&
longname
[
0
]
)
?
(
char
*
)
longname
:
NULL
;
struct
instLoc
state
=
{
.
ip
=
&
ip_ref
,
.
id
=
CDI_UNDEFID
};
cdiResHFilterApply
(
&
instituteOps
,
findInstitute
,
&
state
);
Free
(
ip_ref
);
return
state
.
id
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment