Fix some more Coverity issues
Fix CID 1171365 Fix CID 1211169 Fix CID 1230038 Fix CID 1295063, 1295062, 1295061 Fix CID 1295070 Fix CID 1295068 Fix CID 12950067
This commit is contained in:
parent
8f1b98be8f
commit
7e79b198b1
|
@ -122,8 +122,12 @@ static RList* symbols(RBinFile *arch) {
|
|||
RBinObject *obj = arch ? arch->o : NULL;
|
||||
RList *ret = r_list_newf (free);
|
||||
|
||||
if (!obj || !obj->bin_obj || !ret)
|
||||
if (!ret)
|
||||
return NULL;
|
||||
if (!obj || !obj->bin_obj) {
|
||||
free (ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(symbols = MACH0_(get_symbols) (obj->bin_obj)))
|
||||
return ret;
|
||||
|
|
|
@ -122,7 +122,7 @@ R_API void r_core_syscmd_ls(const char *input) {
|
|||
path = (const char *)homepath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!r_file_is_directory (path)){
|
||||
p = strrchr(path, '/');
|
||||
if (p){
|
||||
|
@ -136,9 +136,12 @@ R_API void r_core_syscmd_ls(const char *input) {
|
|||
pattern = strdup (path);
|
||||
path = ".";
|
||||
}
|
||||
} else pattern = strdup ("*");
|
||||
} else pattern = strdup ("*");
|
||||
if (r_file_is_regular (path)) {
|
||||
showfile (0, path, path, printfmt);
|
||||
free (homepath);
|
||||
free (pattern);
|
||||
free (d);
|
||||
return;
|
||||
}
|
||||
files = r_sys_dir (path);
|
||||
|
|
|
@ -161,6 +161,8 @@ R_API void r_egg_syscall(REgg *egg, const char *arg, ...) {
|
|||
if (!strcmp (arg, "close")) {
|
||||
//egg->remit->syscall_args ();
|
||||
}
|
||||
if (!item)
|
||||
return;
|
||||
egg->remit->syscall (egg, item->num);
|
||||
}
|
||||
|
||||
|
|
|
@ -382,7 +382,6 @@ R_API char *r_egg_mkvar(REgg *egg, char *out, const char *_str, int delta) {
|
|||
rcc_pushstr (egg, str, mustfilter);
|
||||
ret = r_egg_mkvar (egg, out, foo, 0);
|
||||
}
|
||||
free (oldstr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -578,12 +578,14 @@ RIOZipFileObj* r_io_zip_alloc_zipfileobj(const char *archivename, const char *fi
|
|||
for (i=0; i < num_entries; i++) {
|
||||
zip_stat_init (&sb);
|
||||
zip_stat_index (zipArch, i, 0, &sb);
|
||||
if (strcmp (sb.name, filename) == 0) {
|
||||
zfo = r_io_zip_create_new_file (
|
||||
archivename, filename, &sb,
|
||||
flags, mode, rw);
|
||||
r_io_zip_slurp_file (zfo);
|
||||
break;
|
||||
if (sb.name != NULL) {
|
||||
if (strcmp (sb.name, filename) == 0) {
|
||||
zfo = r_io_zip_create_new_file (
|
||||
archivename, filename, &sb,
|
||||
flags, mode, rw);
|
||||
r_io_zip_slurp_file (zfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!zfo)
|
||||
|
|
|
@ -180,6 +180,7 @@ R_API int r_socket_connect (RSocket *s, const char *host, const char *port, int
|
|||
if (ret == -1) {
|
||||
close (s->fd);
|
||||
s->fd = -1;
|
||||
freeaddrinfo (res);
|
||||
return R_FALSE;
|
||||
}
|
||||
freeaddrinfo (res);
|
||||
|
|
|
@ -721,10 +721,13 @@ int send_ack(libgdbr_t* g) {
|
|||
}
|
||||
|
||||
int send_command(libgdbr_t* g, const char* command) {
|
||||
uint8_t checksum = cmd_checksum (command);
|
||||
uint8_t checksum;
|
||||
int ret;
|
||||
|
||||
if (!g || !command)
|
||||
return -1;
|
||||
|
||||
checksum = cmd_checksum (command);
|
||||
ret = snprintf(g->send_buff, g->send_max,
|
||||
"$%s#%.2x", command, checksum);
|
||||
if (ret >= 0) {
|
||||
|
|
Loading…
Reference in New Issue