Skip to content

Commit

Permalink
fix a few code defects detected by coverity scan
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Feb 2, 2014
1 parent 7b804f0 commit e12e6c0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ static Value *emit_cglobal(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
msg << sym.f_lib;
}
emit_error(msg.str(), ctx);
res = literal_static_pointer_val(NULL, lrt);
}
// since we aren't saving this code, there's no sense in
// putting anything complicated here: just JIT the address of the cglobal
Expand Down
1 change: 1 addition & 0 deletions src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jl_value_t *jl_callback_call(jl_function_t *f,jl_value_t *val,int count,...)
break;
}
}
va_end(argp);
v = jl_apply(f,(jl_value_t**)argv,count);
JL_GC_POP();
return v;
Expand Down
5 changes: 4 additions & 1 deletion ui/repl-readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ int complete_method_table()
char **methods = malloc(sizeof(char *)*(nallocmethods+1));
methods[0] = NULL;
methods[1] = strtok_r(completions, "\n", &strtok_saveptr);
if (methods[1] == NULL) return 0;
if (methods[1] == NULL) {
free(methods);
return 0;
}
int maxlen = strlen(methods[1]);
int nmethods = 1;

Expand Down
2 changes: 1 addition & 1 deletion ui/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void parse_opts(int *argcp, char ***argvp)
}
if (image_file) {
if (image_file[0] != PATHSEP) {
struct stat stbuf;
uv_stat_t stbuf;
char path[512];
if (!imagepathspecified) {
// build time path relative to JULIA_HOME
Expand Down

0 comments on commit e12e6c0

Please sign in to comment.