OSDN Git Service

fix for error case finalize.
authorornse01 <ornse01@users.sourceforge.jp>
Sun, 8 May 2011 08:13:13 +0000 (08:13 +0000)
committerornse01 <ornse01@users.sourceforge.jp>
Sun, 8 May 2011 08:13:13 +0000 (08:13 +0000)
git-svn-id: http://svn.sourceforge.jp/svnroot/bchan/bchan/trunk@271 20a0b8eb-f62a-4a12-8fe1-b598822500fb

src/postres.c

index e15492c..6a8944d 100644 (file)
@@ -314,6 +314,12 @@ EXPORT W postresdata_genrequestbody(postresdata_t *post, UB *board, W board_len,
        UB name_MESSAGE[] = "&MESSAGE=";
        UB name_submit[] = "&submit=%8F%91%82%AB%8D%9E%82%DE";
 
+       buf_ret = malloc(sizeof(UB));
+       if (buf_ret == NULL) {
+               return -1; /* TODO */
+       }
+       buf_ret[0] = '\0';
+
        err = postresdata_appendasciistring(&buf_ret, &buf_ret_len, name_bbs, strlen(name_bbs));
        if (err < 0) {
                free(buf_ret);