Fix #585 - Segfault in echo q | r2 -d lib

This commit is contained in:
pancake 2014-03-02 04:36:27 +01:00
parent f3a83d63f3
commit 7d1a63a545
2 changed files with 5 additions and 3 deletions

View File

@ -35,7 +35,7 @@ R_API RFlag *r_flag_free(RFlag *f) {
RListIter *iter;
r_list_foreach (f->flags, iter, item) {
RList *list = r_hashtable64_lookup (f->ht_name, item->namehash);
r_list_free (list);
// XXX r_list_free (list);
list = r_hashtable64_lookup (f->ht_off, item->offset);
// XXX: segfault sometimes wtf -- r_list_free (list);
}

View File

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2013 - pancake */
/* radare - LGPL - Copyright 2013-2014 - pancake */
#include "r_types.h"
#include "r_util.h"
@ -15,7 +15,9 @@ R_API void r_strbuf_init(RStrBuf *sb) {
}
R_API int r_strbuf_set(RStrBuf *sb, const char *s) {
int l = strlen (s);
int l;
if (!sb || !s) return R_FALSE;
l = strlen (s);
if (l>=sizeof (sb->buf)) {
char *ptr = malloc (l+1);
if (!ptr)