diff -ur curl-7.38.0-orig/lib/smtp.c curl-7.38.0/lib/smtp.c
--- curl-7.38.0-orig/lib/smtp.c	2014-09-07 17:50:41.000000000 -0400
+++ curl-7.38.0/lib/smtp.c	2014-09-26 14:50:24.095056874 -0400
@@ -1835,21 +1835,28 @@
       len -= 2;
     }
 
+    if (!(eob = strdup(eob)))
+      return CURLE_OUT_OF_MEMORY;
+
     /* Send the end of block data */
     result = Curl_write(conn, conn->writesockfd, eob, len, &bytes_written);
-    if(result)
+    if(result) {
+      free(eob);
       return result;
+    }
 
     if(bytes_written != len) {
       /* The whole chunk was not sent so keep it around and adjust the
          pingpong structure accordingly */
-      pp->sendthis = strdup(eob);
+      pp->sendthis = eob;
       pp->sendsize = len;
       pp->sendleft = len - bytes_written;
     }
-    else
+    else {
       /* Successfully sent so adjust the response timeout relative to now */
       pp->response = Curl_tvnow();
+      free(eob);
+    }
 
     state(conn, SMTP_POSTDATA);
 
