projects
/
fwknop.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
060fbb6
)
[libfko] minor memory leak fix for user detection (corner case)
author
Michael Rash
<mbr@cipherdyne.org>
Mon, 30 Jul 2012 01:31:44 +0000 (21:31 -0400)
committer
Michael Rash
<mbr@cipherdyne.org>
Tue, 31 Jul 2012 02:34:15 +0000 (22:34 -0400)
lib/fko_user.c
patch
|
blob
|
history
diff --git
a/lib/fko_user.c
b/lib/fko_user.c
index
37756b3
..
9c2a5ed
100644
(file)
--- a/
lib/fko_user.c
+++ b/
lib/fko_user.c
@@
-74,7
+74,11
@@
fko_set_username(fko_ctx_t ctx, const char *spoof_user)
/* if we still didn't get a username, fall back
*/
if((username = getenv("USER")) == NULL)
+ {
username = strdup("NO_USER");
+ if(username == NULL)
+ return(FKO_ERROR_MEMORY_ALLOCATION);
+ }
}
}