Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb0eb98
)
adding error handling in runas.c in case the malloc() fails
author
pengzhao
<pengzhao>
Tue, 18 Mar 2003 05:22:39 +0000
(
05:22
+0000)
committer
pengzhao
<pengzhao>
Tue, 18 Mar 2003 05:22:39 +0000
(
05:22
+0000)
lustre/tests/runas.c
patch
|
blob
|
history
diff --git
a/lustre/tests/runas.c
b/lustre/tests/runas.c
index
348ddb9
..
8731699
100644
(file)
--- a/
lustre/tests/runas.c
+++ b/
lustre/tests/runas.c
@@
-80,6
+80,11
@@
main(int argc, char**argv)
// assemble the command
my_argv = (char**)malloc(sizeof(char*)*(argc+1-optind));
+ if(my_argv == NULL) {
+ fprintf(stderr, "Error in allocating memory. (%s)\n", strerror(errno));
+ exit(-1);
+ }
+
for(i=optind; i< argc; i++) {
my_argv[i-optind] = argv[i];
// printf("%s\n",my_argv[i-optind]);