Version: 1
-Previous: ae3853ad6bbf3f2765c5c35e272d719b77a255be
-Head: 04f9b1ceff06e839001f5cd98f56eba9fc9579fa
+Previous: dd9c71ad0ebfe958e1eca5d078a1f44e929b07aa
+Head: 5de1f5ff6aaca3df63dc3165c63bd37ba24b7723
Applied:
- p: 6de595d4115ab6aebfd9dacbbe6c215d8966d4b3
- refresh-temp: 04f9b1ceff06e839001f5cd98f56eba9fc9579fa
+ p: 5de1f5ff6aaca3df63dc3165c63bd37ba24b7723
Unapplied:
malloc-err: 57342da6cab0db5b9b5dd2f5e75284d1500d2132
af_ib: 414c0cd9299eadb9748ce805155e267ba6bff585
Bottom: 42e4729a57fa30e42770d8787e4b6b02c7bf2204
-Top: ed6a134db24d206a944a53a1ebb514d04d70b176
+Top: b0bae9f13e357fe01c3e0e890cc06e7fe5b01317
Author: Dotan Barak <dotanb@dev.mellanox.co.il>
Date: 2011-11-28 12:21:37 -0800
---
diff --git a/src/parse.c b/src/parse.c
-index d1c820f..6ab6041 100644
+index d1c820f..9a01afb 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -71,14 +71,15 @@ static char *expand(char *basename, char *args, int *str_cnt, int *str_size)
if (args[0] == '[') {
cpy[0] = '\0';
-@@ -92,6 +93,8 @@ char **parse(char *args, int *count)
+@@ -92,6 +93,9 @@ char **parse(char *args, int *count)
if (!next) {
str_size = strlen(token) + 1;
str_buf = malloc(str_size);
+ if (!str_buf)
+ goto out_cpy;
++
strcpy(str_buf, token);
cnt = 1;
} else {
-@@ -99,6 +102,9 @@ char **parse(char *args, int *count)
+@@ -99,6 +103,9 @@ char **parse(char *args, int *count)
}
ptrs = malloc((sizeof str_buf * (cnt + 1)) + str_size);
memcpy(&ptrs[cnt + 1], str_buf, str_size);
ptrs[0] = (char*) &ptrs[cnt + 1];
-@@ -106,10 +112,14 @@ char **parse(char *args, int *count)
+@@ -106,10 +113,12 @@ char **parse(char *args, int *count)
ptrs[i] = index(ptrs[i - 1], 0) + 1;
ptrs[i] = NULL;
+
+out_str_buf:
+ free(str_buf);
-+
+out_cpy:
+ free(cpy);
-+
return ptrs;
}
+++ /dev/null
-Bottom: ed6a134db24d206a944a53a1ebb514d04d70b176
-Top: b0bae9f13e357fe01c3e0e890cc06e7fe5b01317
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2011-11-28 12:23:53 -0800
-
-Refresh of p
-
----
-
-diff --git a/src/parse.c b/src/parse.c
-index 6ab6041..9a01afb 100644
---- a/src/parse.c
-+++ b/src/parse.c
-@@ -95,6 +95,7 @@ char **parse(char *args, int *count)
- str_buf = malloc(str_size);
- if (!str_buf)
- goto out_cpy;
-+
- strcpy(str_buf, token);
- cnt = 1;
- } else {
-@@ -117,9 +118,7 @@ char **parse(char *args, int *count)
-
- out_str_buf:
- free(str_buf);
--
- out_cpy:
- free(cpy);
--
- return ptrs;
- }