Fix dstr_own() when the dstr already holds a string.

This commit is contained in:
Nils O. Selåsdal
2015-05-06 21:33:23 +02:00
parent bb426bfecd
commit a7516141dd
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ void uc_dstr_own(struct DStr *str, char *restrict s)
size_t len = strlen(s);
if (str->str) {
free(str);
free(str->str);
}
str->len = len;