Don't check pointers to NULL before pass it to free() because it's superfluous.
No functional change.
Found by cppcheck:
[./src/lib/create.c:328]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/lib/env.c:179]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/lib/env.c:568]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/lib/exec.c:429]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/lib/script.c:65]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/lib/vps_configure.c:180]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/lib/vps_configure.c:305]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzctl-actions.c:573]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzctl-actions.c:623]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzctl.c:314]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzlist.c:777]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzlist.c:955]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzlist.c:957]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzlist.c:1715]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzlist.c:1716]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./src/vzlist.c:1717]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[kir@openvz.org: removed the following buggy hunk:
if (tmp->ip == NULL)
tmp->ip = ip;
- else if (ip != NULL)
- free(ip);
+ free(ip);
http://bugzilla.openvz.org/1306
8 files changed