Changeset 47f5a77 in mainline for uspace/srv/net/tcp/sock.c


Ignore:
Timestamp:
2013-07-17T08:46:06Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a0a4d8
Parents:
cdc3afa (diff), 1d94e21 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/sock.c

    rcdc3afa r47f5a77  
    613613        ipc_callid_t wcallid;
    614614        size_t length;
    615         uint8_t buffer[TCP_SOCK_FRAGMENT_SIZE];
    616615        tcp_error_t trc;
    617616        int rc;
     617       
     618        uint8_t *buffer = calloc(TCP_SOCK_FRAGMENT_SIZE, 1);
     619        if (buffer == NULL) {
     620                async_answer_0(callid, ENOMEM);
     621                return;
     622        }
    618623
    619624        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_send()");
     
    625630        if (sock_core == NULL) {
    626631                async_answer_0(callid, ENOTSOCK);
    627                 return;
     632                goto out;
    628633        }
    629634
     
    641646                        fibril_mutex_unlock(&socket->lock);
    642647                        async_answer_0(callid, EINVAL);
    643                         return;
     648                        goto out;
    644649                }
    645650
     
    651656                        fibril_mutex_unlock(&socket->lock);
    652657                        async_answer_0(callid, rc);
    653                         return;
     658                        goto out;
    654659                }
    655660
     
    676681                        fibril_mutex_unlock(&socket->lock);
    677682                        async_answer_0(callid, rc);
    678                         return;
     683                        goto out;
    679684                }
    680685        }
     
    685690            IPC_GET_ARG2(answer));
    686691        fibril_mutex_unlock(&socket->lock);
     692       
     693out:
     694        free(buffer);
    687695}
    688696
Note: See TracChangeset for help on using the changeset viewer.