summaryrefslogtreecommitdiff
path: root/user/tlecarrour
diff options
context:
space:
mode:
Diffstat (limited to 'user/tlecarrour')
-rw-r--r--user/tlecarrour/porting_guide_for_dummies.mdwn4
1 files changed, 3 insertions, 1 deletions
diff --git a/user/tlecarrour/porting_guide_for_dummies.mdwn b/user/tlecarrour/porting_guide_for_dummies.mdwn
index 64f0ba0d..cdab3508 100644
--- a/user/tlecarrour/porting_guide_for_dummies.mdwn
+++ b/user/tlecarrour/porting_guide_for_dummies.mdwn
@@ -217,8 +217,10 @@ The code comes from [[https://buildsecurityin.us-cert.gov/bsi/articles/knowledge
if (buff == NULL)
return NULL;
int nchars = readlink(filename, buff, size);
- if (nchars < 0)
+ if (nchars < 0) {
+ free(buff);
return NULL;
+ }
if (nchars < size) {
buff[nchars] = '\0';
return buff;