Changeset 87e9392 in mainline for uspace/srv/logger/logs.c


Ignore:
Timestamp:
2012-10-08T06:16:46Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
062d900, d1ef4a1
Parents:
000494d
Message:

Prevent fclose(NULL) in logger (#498)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/logger/logs.c

    r000494d r87e9392  
    268268
    269269        if (log->parent == NULL) {
    270                 fclose(log->dest->logfile);
     270                /*
     271                 * Due to lazy file opening in write_to_log(),
     272                 * it is possible that no file was actually opened.
     273                 */
     274                if (log->dest->logfile != NULL) {
     275                        fclose(log->dest->logfile);
     276                }
    271277                free(log->dest->filename);
    272278                free(log->dest);
Note: See TracChangeset for help on using the changeset viewer.