Skip to content

Commit 6eb94a5

Browse files
committed
test/engine: Fix sanitizer findings
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
1 parent 0713d52 commit 6eb94a5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test/engine/enginectrl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,22 @@ void setup(void)
3030
#endif
3131
}
3232

33+
typedef void (*ica_cleanup_t) (void);
34+
3335
int initwithlib(ENGINE *e, const char *lib, int checkexists, int expectedinitval)
3436
{
3537
void *hdl;
38+
void (*ica_cleanup)(void);
3639

3740
if (checkexists) {
3841
hdl = dlopen(lib, RTLD_LAZY);
3942
if (hdl == NULL) {
4043
fprintf(stderr, "Skipping initialization with non-existent library \"%s\"\n", lib);
4144
return 1;
4245
}
46+
*(void **)(&ica_cleanup) = dlsym(hdl, "ica_cleanup");
47+
if (ica_cleanup != NULL)
48+
ica_cleanup();
4349
dlclose(hdl);
4450
}
4551
if (ENGINE_ctrl_cmd_string(e, "libica", lib, 0) != 1) {

test/engine/threadtest.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ int main(int argc, char **argv)
145145

146146
if (setup() != 1) {
147147
fprintf(stderr, "Failed to set up test. Skipping...\n");
148+
free(threads);
148149
return 77;
149150
}
150151

@@ -170,5 +171,6 @@ int main(int argc, char **argv)
170171
}
171172
}
172173
}
174+
free(threads);
173175
return errors ? 99 : 0;
174176
}

0 commit comments

Comments
 (0)