correct usage of free for strdup memory
[ric-plt/xapp-frame-cpp.git] / src / config / config.cpp
index 9d7776d..5259a17 100644 (file)
@@ -91,13 +91,13 @@ void xapp::Config::Listener( ) {
                *tok = 0;
                bname = strdup( tok+1 );
        } else {
-               delete dname;
+               free (dname);
                dname = strdup( "." );
                bname = strdup( fname.c_str() );
        }
 
        wfd = inotify_add_watch( ifd, dname, IN_MOVED_TO | IN_CLOSE_WRITE );            // we only care about close write changes
-       delete dname;
+       free (dname);
 
        if( wfd < 0 ) {
                fprintf( stderr, "<XFCPP> ### ERR ### unable to add watch on config file %s: %s\n", fname.c_str(), strerror( errno ) );