]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
refresh (create temporary patch)
authorSean Hefty <sean.hefty@intel.com>
Mon, 28 Nov 2011 20:21:29 +0000 (12:21 -0800)
committerSean Hefty <sean.hefty@intel.com>
Mon, 28 Nov 2011 20:21:29 +0000 (12:21 -0800)
meta
patches/refresh-temp [new file with mode: 0644]

diff --git a/meta b/meta
index 2c34366d57cdf100b584f1f75b481dcad0ed2908..1052030fe6645e8d36dd317ecb8a9aa9874fddc0 100644 (file)
--- a/meta
+++ b/meta
@@ -1,8 +1,9 @@
 Version: 1
-Previous: ae5c3b8ff33dccf14c14d8cd10937814d08bbacc
-Head: 897f45e8453eab4bfeed1549a718a5149c711600
+Previous: 30e17680cc35e44f297ff53cff9f21e7826c6615
+Head: 1ab73cbe99eadc20eb6b8fdd03dbd8be5a83a0df
 Applied:
   malloc-err: 897f45e8453eab4bfeed1549a718a5149c711600
+  refresh-temp: 1ab73cbe99eadc20eb6b8fdd03dbd8be5a83a0df
 Unapplied:
   af_ib: 414c0cd9299eadb9748ce805155e267ba6bff585
   name2ip: 8e00708e882239292492e13aa51c82042255933c
diff --git a/patches/refresh-temp b/patches/refresh-temp
new file mode 100644 (file)
index 0000000..91a4af4
--- /dev/null
@@ -0,0 +1,69 @@
+Bottom: 42e4729a57fa30e42770d8787e4b6b02c7bf2204
+Top:    ed6a134db24d206a944a53a1ebb514d04d70b176
+Author: Sean Hefty <sean.hefty@intel.com>
+Date:   2011-11-28 12:21:28 -0800
+
+Refresh of malloc-err
+
+---
+
+diff --git a/src/parse.c b/src/parse.c
+index d1c820f..6ab6041 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)
+ char **parse(char *args, int *count)
+ {
+-      char **ptrs;
++      char **ptrs = NULL;
+       char *str_buf, *cpy, *token, *next;
+       int cnt = 0, str_size = 0;
+       int i;
+       /* make a copy that strtok can modify */
+-      cpy = malloc(strlen(args) + 1);
+-      strcpy(cpy, args);
++      cpy = strdup(args);
++      if (!cpy)
++              return NULL;
+       if (args[0] == '[') {
+               cpy[0] = '\0';
+@@ -92,6 +93,8 @@ 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)
+       }
+       ptrs = malloc((sizeof str_buf * (cnt + 1)) + str_size);
++      if (!ptrs)
++              goto out_str_buf;
++
+       memcpy(&ptrs[cnt + 1], str_buf, str_size);
+       ptrs[0] = (char*) &ptrs[cnt + 1];
+@@ -106,10 +112,14 @@ char **parse(char *args, int *count)
+               ptrs[i] = index(ptrs[i - 1], 0) + 1;
+       ptrs[i] = NULL;
+-      free(cpy);
+-      free(str_buf);
+-
+       if (count)
+               *count = cnt;
++
++out_str_buf:
++        free(str_buf);
++
++out_cpy:
++      free(cpy);
++
+       return ptrs;
+ }