libobs/util: Fix warnings for about null usages
This commit is contained in:
parent
cacc65f978
commit
d5e265d7dd
@ -409,8 +409,10 @@ static inline void darray_move_item(const size_t element_size,
|
||||
return;
|
||||
|
||||
temp = malloc(element_size);
|
||||
if (!temp)
|
||||
if (!temp) {
|
||||
bcrash("darray_move_item: out of memory");
|
||||
return;
|
||||
}
|
||||
|
||||
p_from = darray_item(element_size, dst, from);
|
||||
p_to = darray_item(element_size, dst, to);
|
||||
|
@ -229,8 +229,7 @@ static inline void dstr_ensure_capacity(struct dstr *dst, const size_t new_size)
|
||||
|
||||
static inline void dstr_copy_dstr(struct dstr *dst, const struct dstr *src)
|
||||
{
|
||||
if (dst->array)
|
||||
dstr_free(dst);
|
||||
dstr_free(dst);
|
||||
|
||||
if (src->len) {
|
||||
dstr_ensure_capacity(dst, src->len + 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user