[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master da7aafb 3/3: Merged memory size allocation fix
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master da7aafb 3/3: Merged memory size allocation fix |
Date: |
Mon, 25 Jul 2016 00:08:33 +0000 (UTC) |
branch: master
commit da7aafb6f844e037a1a5065450a8da67eeb38c10
Merge: 1113b5d 6c6c6dd
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
Merged memory size allocation fix
Vladimir's memory size allocation correction (commit 6c6c6dd) is now merged
with master.
---
lib/checkset.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/checkset.c b/lib/checkset.c
index 1e089ba..bc32a65 100644
--- a/lib/checkset.c
+++ b/lib/checkset.c
@@ -845,9 +845,9 @@ gal_checkset_not_dir_part(char *input)
/* Get the length of the notdir name: */
l=strlen(tmp);
errno=0;
- out=malloc(l*sizeof *out);
+ out=malloc((l+1)*sizeof *out);
if(out==NULL)
- error(EXIT_FAILURE, errno, "%lu bytes for notdir", l*sizeof *out);
+ error(EXIT_FAILURE, errno, "%lu bytes for notdir", (l+1)*sizeof *out);
strcpy(out, tmp);
return out;