Checking success of strdup(). Indirectly found by Coverity CID 12548.

This commit is contained in:
Thomas Schmitt 2015-10-11 16:11:02 +02:00
parent 7bdc4c96f5
commit b904926443
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2007 Vreixo Formoso * Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2011 - 2014 Thomas Schmitt * Copyright (c) 2011 - 2015 Thomas Schmitt
* *
* This file is part of the libisofs project; you can redistribute it and/or * This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2 * modify it under the terms of the GNU General Public License version 2
@ -1199,6 +1199,8 @@ int iso_tree_path_to_node_flag(IsoImage *image, const char *path,
} }
ptr = strdup(path); ptr = strdup(path);
if (ptr == NULL)
return ISO_OUT_OF_MEM;
result = 0; result = 0;
/* get the first component of the path */ /* get the first component of the path */