projects
/
trust_router.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix memory freeing bugs. Seems stable, even through loss of connections.
[trust_router.git]
/
common
/
tr_name.c
diff --git
a/common/tr_name.c
b/common/tr_name.c
index
41cad47
..
e048731
100644
(file)
--- a/
common/tr_name.c
+++ b/
common/tr_name.c
@@
-55,6
+55,9
@@
TR_NAME *tr_new_name (char *name)
new->len = strlen(name);
if (new->buf = malloc((new->len)+1)) {
strcpy(new->buf, name);
+ } else {
+ free(new);
+ new=NULL;
}
}
return new;
@@
-120,4
+123,3
@@
char * tr_name_strdup(TR_NAME *src)
return s;
}
-