Changeset e761fb4 in rtems for cpukit


Ignore:
Timestamp:
Oct 5, 2018, 12:05:22 PM (13 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
dcf42bb2
Parents:
05b5f9c0
git-author:
Sebastian Huber <sebastian.huber@…> (10/05/18 12:05:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/05/18 12:05:54)
Message:

ftpd: Avoid NULL pointer checks before free()

They are superfluous and just bloat the code.

Update #3530.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ftpd/ftpd.c

    r05b5f9c0 re761fb4  
    374374  for(i = 0; i < count; ++i)
    375375    rtems_task_delete(task_pool.info[i].tid);
    376   if(task_pool.info)
    377     free(task_pool.info);
    378   if(task_pool.queue)
    379     free(task_pool.queue);
     376  free(task_pool.info);
     377  free(task_pool.queue);
    380378  rtems_mutex_destroy(&task_pool.mutex);
    381379  rtems_counting_semaphore_destroy(&task_pool.sem);
     
    17411739  {
    17421740    sscanf(args, "%254s", fname);
    1743     if (info->user)
    1744       free(info->user);
    1745     if (info->pass)
    1746       free(info->pass);
     1741    free(info->user);
     1742    free(info->pass);
    17471743    info->pass = NULL;
    17481744    info->user = strdup(fname);
     
    17591755  {
    17601756    sscanf(args, "%254s", fname);
    1761     if (info->pass)
    1762       free(info->pass);
     1757    free(info->pass);
    17631758    info->pass = strdup(fname);
    17641759    if (!info->user) {
Note: See TracChangeset for help on using the changeset viewer.